/* ════════════════════════════════════════
   Devi Portfolio — pixel single-page
   Palette: pink #F39EB6/#C4638A · green #8CCB4A/#5C8934
   cream #FFF6E0/#F7F6D3 · night #201F45/#3B3E7A · text #3D2B1F
   ════════════════════════════════════════ */

html { scroll-behavior: smooth; }

body {
    margin: 0;
    min-height: 100vh;
    font-family: 'JetBrains Mono', Consolas, monospace;
    color: #3D2B1F;
    overflow-x: hidden;
    background: #F7F6D3;
}

/* ── Keyframes ── */
@keyframes dfSpriteIdle { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes dfBlink      { 0%,100% { opacity: 1; } 50% { opacity: 0; } }
@keyframes dfFadeDown   { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dfFadeUp     { from { opacity: 0; transform: translateY(20px); }  to { opacity: 1; transform: translateY(0); } }
@keyframes dfFadeLeft   { from { opacity: 0; transform: translateX(-24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes dfPopIn      { 0% { opacity: 0; transform: scale(.5) rotate(-10deg); } 70% { opacity: 1; transform: scale(1.08) rotate(2deg); } 100% { opacity: 1; transform: scale(1) rotate(0); } }
@keyframes dfNavIn      { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dfTwinkle    { 0%,100% { opacity: 0.2; } 50% { opacity: 1; } }
@keyframes dfBounceHint { 0%,100% { transform: translateY(0); } 50% { transform: translateY(8px); } }
@keyframes dfWalkBob    { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes dfCoinFloat  { 0%,100% { transform: translate(-50%, 0); } 50% { transform: translate(-50%, -8px); } }
@keyframes dfPlaneBob   { 0%,100% { transform: rotate(-8deg) translateY(0); } 50% { transform: rotate(-8deg) translateY(-6px); } }

/* ── Nav ── */
nav {
    padding: 0.85rem 2rem;
    border-bottom: 4px solid #F39EB6;
    box-shadow: 0 4px 0 #C4638A;
    position: sticky;
    top: 0;
    background: #FFE4EF;
    z-index: 200;
}
nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 1.75rem;
    max-width: 1000px;
    margin: 0 auto;
    padding: 0;
    flex-wrap: wrap;
}
nav li {
    animation: dfNavIn 400ms ease both;
    animation-delay: calc(var(--i) * 60ms);
}
nav a {
    color: #3D2B1F;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.1s;
}
nav a:hover { color: #C4638A; }
nav a .nav-arrow { color: #F39EB6; opacity: 0; }
nav a:hover .nav-arrow { opacity: 1; }

/* ── Hero ── */
#hero {
    border-bottom: 4px solid #F39EB6;
    box-shadow: 0 4px 0 #C4638A;
    padding: 3rem 2rem 2.5rem;
    background-image:
        linear-gradient(180deg, #FFE9B8 0%, #FFDCC2 55%, #FDE9B8 100%),
        linear-gradient(rgba(184,219,128,0.16) 1px, transparent 1px),
        linear-gradient(90deg, rgba(184,219,128,0.16) 1px, transparent 1px);
    background-size: auto, 24px 24px, 24px 24px;
}
.hero-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
    animation: dfFadeDown 550ms ease both;
}
.hero-sprite {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    animation: dfSpriteIdle 2.5s ease-in-out infinite;
}
.hero-sprite-frame {
    border: 3px solid #F39EB6;
    box-shadow: 4px 4px 0 #C4638A;
    padding: 0.3rem;
    background: rgba(247,246,211,0.55);
    line-height: 0;
}
.hero-sprite-frame img {
    height: 150px;
    width: auto;
    image-rendering: pixelated;
    display: block;
}
.hero-player-tag {
    font-size: 0.75rem;
    background: #8CCB4A;
    border: 2px solid #3D2B1F;
    box-shadow: 2px 2px 0 #5C8934;
    padding: 0.2rem 0.5rem;
    white-space: nowrap;
}
.hero-main { flex: 1; min-width: 260px; }
.hero-name {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.85rem;
    text-shadow: 3px 3px 0 #F39EB6;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    color: #C4638A;
}
.hero-cursor { animation: dfBlink 1s step-end infinite; color: #F39EB6; }
.hero-class { font-size: 1rem; color: #C4638A; margin-bottom: 0.9rem; }
.hero-bio { font-size: 1rem; line-height: 2.2; max-width: 560px; margin: 0 0 0.6rem; }
.hero-hint {
    font-size: 0.8rem;
    color: #5C8934;
    letter-spacing: 0.06em;
    animation: dfBounceHint 1.4s ease-in-out infinite;
}
.traits-card {
    flex-shrink: 0;
    min-width: 170px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    background: #FFE4EF;
    border: 3px solid #F39EB6;
    box-shadow: 4px 4px 0 #C4638A;
    padding: 0.9rem 1.1rem;
}
.traits-header {
    font-size: 0.7rem;
    color: #C4638A;
    border-bottom: 2px dashed #F39EB6;
    padding-bottom: 0.4rem;
    margin-bottom: 0.2rem;
}
.trait { display: flex; align-items: center; gap: 0.5rem; }
.trait-icon { font-size: 1rem; }
.trait-name { font-size: 0.72rem; color: #3D2B1F; }
.traits-lore {
    font-size: 0.68rem;
    color: #5C8934;
    line-height: 1.8;
    margin-top: 0.3rem;
    border-top: 2px dashed #8CCB4A;
    padding-top: 0.4rem;
}

/* ── Journey (game) ── */
#journey {
    position: relative;
    width: 100%;
    padding: 2.5rem 2rem 1rem;
    background: linear-gradient(180deg, #FDE9B8 0%, #C98FC9 55%, #3B3E7A 100%);
    box-sizing: border-box;
}
.journey-head, .journey-controls {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.75rem;
}
.journey-head { margin-bottom: 1rem; }
.journey-title {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.9rem;
    color: #FFF6E0;
    text-shadow: 2px 2px 0 #6A5A9E;
}
.journey-progress { font-size: 0.75rem; color: #FFF6E0; }

#game-viewport {
    position: relative;
    max-width: 960px;
    margin: 0 auto;
    height: 440px;
    overflow: hidden;
    border: 3px solid #3D2B1F;
    box-shadow: 5px 5px 0 #201F45;
    outline: none;
    cursor: pointer;
}
#game-world {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    will-change: transform;
    background: linear-gradient(180deg,
        #FDE9B8 0%, #FBD3A9 18%, #F3B7CE 34%, #C98FC9 50%,
        #8C7FC0 64%, #5C6FAE 78%, #3B3E7A 90%, #201F45 100%);
}
.star {
    position: absolute;
    width: 3px;
    height: 3px;
    background: #FFF6E0;
    animation: dfTwinkle 2s ease-in-out infinite;
}
.ground-line {
    position: absolute;
    left: 0;
    bottom: 64px;
    width: 100%;
    height: 4px;
    background: #8CCB4A;
    box-shadow: 0 2px 0 #5C8934;
}
.ground-fill {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 64px;
    background: rgba(32,31,69,0.15);
}
.obstacle {
    position: absolute;
    bottom: 64px;
    transform: translateX(-50%);
    z-index: 2;
    line-height: 1;
}
.coin {
    position: absolute;
    bottom: 154px;
    font-size: 1.7rem;
    z-index: 2;
    animation: dfCoinFloat 1.6s ease-in-out infinite;
}
.coin.taken { display: none; }

.station-dot {
    position: absolute;
    bottom: 64px;
    transform: translateX(-50%);
    z-index: 2;
    width: 14px;
    height: 14px;
    border: 2px solid #3D2B1F;
    background: rgba(255,246,224,0.35);
    box-sizing: border-box;
}
.station-card-wrap {
    position: absolute;
    bottom: 96px;
    transform: translateX(-50%);
    width: 220px;
    z-index: 3;
    opacity: 0.35;
    filter: grayscale(0.6);
    transition: opacity 400ms ease, filter 400ms ease;
}
.station-card {
    border: 3px solid rgba(255,246,224,0.4);
    background: rgba(32,31,69,0.25);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.2);
    padding: 0.75rem 0.9rem;
}
.station-card-head { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.station-icon { font-size: 1.2rem; }
.station-title { font-size: 0.78rem; color: #FFF6E0; }
.station-period { font-size: 0.64rem; color: #FFF6E0; margin-bottom: 0.45rem; }
.station-body { font-size: 0.72rem; line-height: 1.8; color: #FFF6E0; }
.station-item {
    margin-top: 0.5rem;
    padding-top: 0.4rem;
    border-top: 2px dashed rgba(255,246,224,0.4);
    font-size: 0.64rem;
    color: #FFF6E0;
}
.station.unlocked .station-dot { background: #8CCB4A; box-shadow: 2px 2px 0 #5C8934; }
.station.unlocked .station-card-wrap { opacity: 1; filter: none; }
.station.unlocked .station-card { border-color: #8CCB4A; background: #FFF9E8; box-shadow: 4px 4px 0 #5C8934; }
.station.unlocked .station-title { color: #C4638A; }
.station.unlocked .station-period { color: #C4638A; }
.station.unlocked .station-body { color: #3D2B1F; }
.station.unlocked .station-item { border-top-color: #8CCB4A; color: #5C8934; }

#player {
    position: absolute;
    z-index: 4;
    width: 44px;
    height: 52px;
}
#player-flip {
    position: absolute;
    bottom: 0;
    left: 50%;
}
#player-flip img {
    height: 48px;
    width: auto;
    image-rendering: pixelated;
    display: block;
    margin: 0 auto;
}
#player.walking #player-flip img { animation: dfWalkBob 0.28s ease-in-out infinite; }
#player-plane {
    font-size: 2.2rem;
    line-height: 1;
    display: none;
    animation: dfPlaneBob 1s ease-in-out infinite;
}
#player.flying #player-flip img { display: none; }
#player.flying #player-plane { display: block; }

#game-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(32,31,69,0.45);
    z-index: 10;
}
#game-hint.hidden { display: none; }
#game-hint div {
    font-family: 'Press Start 2P', monospace;
    font-size: 0.85rem;
    color: #FFF6E0;
    text-align: center;
    text-shadow: 2px 2px 0 #6A5A9E;
    padding: 1rem;
    line-height: 2.4;
}

.journey-controls { margin-top: 0.85rem; }
.journey-keys { font-size: 0.72rem; color: #FFF6E0; }
.touch-buttons { display: flex; gap: 0.6rem; }
.touch-buttons button {
    width: 52px;
    height: 52px;
    font-size: 1.3rem;
    font-family: 'JetBrains Mono', monospace;
    border: 3px solid #3D2B1F;
    cursor: pointer;
    touch-action: none;
    padding: 0;
}
#btn-left, #btn-right { background: #FFE4EF; box-shadow: 3px 3px 0 #C4638A; }
#btn-left:active, #btn-right:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 #C4638A; }
#btn-jump { background: #B8DB80; box-shadow: 3px 3px 0 #5C8934; }
#btn-jump:active { transform: translate(2px,2px); box-shadow: 1px 1px 0 #5C8934; }

/* ── Night → paper transition ── */
.transition-strip {
    height: 60px;
    background: linear-gradient(180deg, #201F45 0%, #F7F6D3 100%);
}

/* ── Paper sections ── */
.paper {
    background-color: #F7F6D3;
    background-image:
        linear-gradient(rgba(184,219,128,0.14) 1px, transparent 1px),
        linear-gradient(90deg, rgba(184,219,128,0.14) 1px, transparent 1px);
    background-size: 24px 24px;
}
.paper section { max-width: 900px; margin: 0 auto; box-sizing: border-box; }
#skills { padding: 4rem 2rem 3rem; }
#achievements { padding: 1rem 2rem 3rem; }
#contact { padding: 1rem 2rem 5rem; }

.pixel-h2 {
    font-family: 'Press Start 2P', monospace;
    font-size: 1.4rem;
    color: #C4638A;
    margin: 0 0 2.5rem;
    display: inline-block;
    background: #FFE4EF;
    border: 3px solid #F39EB6;
    box-shadow: 5px 5px 0 #8CCB4A;
    padding: 0.6rem 1.2rem;
    white-space: nowrap;
    font-weight: normal;
}

/* ── Skills ── */
.skill-bars { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 2.5rem; }
.skill-bar-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    animation: dfFadeLeft 350ms ease both;
    animation-delay: calc(var(--i) * 45ms);
}
.skill-bar-name { font-size: 1rem; min-width: 185px; }
.skill-bar-track { display: flex; gap: 3px; }
.skill-bar-block {
    width: 16px;
    height: 16px;
    border: 2px solid #3D2B1F;
    background: rgba(0,0,0,0.06);
    box-sizing: content-box;
}
.skill-bar-block.filled { background: #8CCB4A; box-shadow: inset -2px -2px 0 #5C8934; }
.skill-bar-lvl { font-size: 0.75rem; color: #C4638A; }

.inventory-divider {
    font-size: 1rem;
    color: #F39EB6;
    text-align: center;
    margin: 1.5rem 0;
    letter-spacing: 0.15em;
}
.inventory { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.inv-item {
    padding: 0.65rem 1rem;
    border: 3px solid #3D2B1F;
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    background: #8CCB4A;
    box-shadow: 4px 4px 0 #5C8934;
    cursor: pointer;
    transition: transform 0.08s, box-shadow 0.08s;
    user-select: none;
    animation: dfPopIn 350ms ease both;
    animation-delay: calc(var(--i) * 40ms);
}
.inv-item:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 #5C8934; }
.inv-item.selected {
    border-color: #C4638A;
    background: #F39EB6;
    box-shadow: 2px 2px 0 #C4638A;
    transform: translate(2px,2px);
}
#skill-info {
    margin-top: 1.5rem;
    padding: 1.25rem;
    border: 3px solid #F39EB6;
    box-shadow: 5px 5px 0 #C4638A;
    background: #FFE4EF;
    font-size: 1rem;
    line-height: 2.4;
    animation: dfFadeUp 250ms ease both;
}
#skill-info[hidden] { display: none; }
.skill-info-head {
    color: #C4638A;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    border-bottom: 2px solid #F39EB6;
    padding-bottom: 0.5rem;
}

/* ── Achievements ── */
.achievements-grid { display: flex; flex-wrap: wrap; gap: 1rem; }
.achievement {
    border: 3px solid #3D2B1F;
    background: #FFCFE2;
    box-shadow: 4px 4px 0 #8CCB4A;
    padding: 1rem 1.25rem;
    width: calc(50% - 0.5rem);
    min-width: 220px;
    box-sizing: border-box;
    transition: transform 0.08s, box-shadow 0.08s;
    animation: dfPopIn 450ms ease both;
    animation-delay: calc(var(--i) * 90ms);
}
.achievement:hover { transform: translate(-2px,-2px) rotate(-1deg); box-shadow: 6px 6px 0 #8CCB4A; }
.achievement-icon { font-size: 1.6rem; margin-bottom: 0.5rem; display: block; }
.achievement-name { font-size: 1rem; color: #C4638A; margin-bottom: 0.5rem; }
.achievement-desc { font-size: 0.875rem; line-height: 2.2; }

/* ── Contact ── */
.contact-list { display: flex; flex-direction: column; gap: 1.5rem; }
.contact-row {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
    animation: dfFadeUp 400ms ease both;
    animation-delay: calc(var(--i) * 100ms);
}
.contact-row strong { font-size: 1rem; color: #C4638A; min-width: 90px; }
.contact-row a {
    font-size: 1rem;
    font-family: 'JetBrains Mono', monospace;
    color: #3D2B1F;
    text-decoration: none;
    background: #8CCB4A;
    border: 3px solid #3D2B1F;
    box-shadow: 4px 4px 0 #5C8934;
    padding: 0.5rem 0.9rem;
    display: inline-block;
    transition: transform 0.08s, box-shadow 0.08s;
}
.contact-row a:hover { transform: translate(-2px,-2px); box-shadow: 6px 6px 0 #5C8934; }
.contact-row a:active { transform: translate(4px,4px); box-shadow: none; }

/* ── Footer ── */
footer {
    text-align: center;
    padding: 2rem;
    border-top: 4px solid #F39EB6;
    box-shadow: 0 -4px 0 #8CCB4A;
    background: #FFE4EF;
    font-size: 0.75rem;
}
footer .star-accent { color: #5C8934; }

/* ── Small screens ── */
@media (max-width: 600px) {
    .hero-name { font-size: 1.35rem; }
    .traits-card { flex-shrink: 1; width: 100%; box-sizing: border-box; }
    .pixel-h2 { font-size: 1rem; box-shadow: 4px 4px 0 #8CCB4A; }
    nav { padding: 0.85rem 1rem; }
    nav ul { gap: 1rem; }
}
