/* =========================================================
   miris.dev — Seapunk Developer Portfolio
   Palette: Deep Ocean #0A2840, Abyss #041828, Frost Cyan #80E0FF,
            Sea Glass #40A0C0, Pale Aqua #C0E8F0, Deep Teal #205868
   Fonts: DM Serif Display, Inter, Fira Code
   ========================================================= */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background: #041828;
    color: #C0E8F0;
    font-family: 'Inter', sans-serif;
    font-weight: 400;
    font-size: clamp(14px, 1vw, 17px);
    line-height: 1.7;
    overflow-x: hidden;
    min-height: 100vh;
}

a {
    color: #80E0FF;
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover {
    color: #C0E8F0;
}

/* --- Caustic Light Overlay --- */
#caustic-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    opacity: 0.07;
    background:
        radial-gradient(ellipse 600px 400px at 30% 20%, rgba(128, 224, 255, 0.4), transparent),
        radial-gradient(ellipse 500px 300px at 70% 60%, rgba(64, 160, 192, 0.3), transparent),
        radial-gradient(ellipse 800px 500px at 50% 40%, rgba(128, 224, 255, 0.2), transparent);
    filter: url(#caustic-filter);
    animation: causticShift 8s ease-in-out infinite alternate;
}

@keyframes causticShift {
    0% { opacity: 0.05; transform: scale(1); }
    50% { opacity: 0.09; transform: scale(1.02); }
    100% { opacity: 0.06; transform: scale(0.98); }
}

/* --- Lens Flare Elements --- */
#lens-flares {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 2;
}

.lens-flare {
    position: absolute;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(128, 224, 255, 0.6) 0%, rgba(128, 224, 255, 0.15) 40%, transparent 70%);
    filter: blur(1px);
    animation: flarePulse 4s ease-in-out infinite alternate;
}

#flare-hero {
    top: 38%;
    left: 42%;
    width: 60px;
    height: 60px;
    opacity: 0;
    animation: flareHeroBurst 1.5s ease-out 0.6s forwards, flarePulse 4s ease-in-out 2s infinite alternate;
}

#flare-grid-tl {
    top: 55%;
    left: 8%;
    opacity: 0.3;
    animation-delay: 1s;
}

#flare-grid-tr {
    top: 52%;
    right: 8%;
    left: auto;
    opacity: 0.25;
    animation-delay: 2.5s;
}

@keyframes flarePulse {
    0% { opacity: 0.2; transform: scale(1); }
    100% { opacity: 0.5; transform: scale(1.3); }
}

@keyframes flareHeroBurst {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 0.8; transform: scale(1.8); }
    100% { opacity: 0.4; transform: scale(1); }
}

/* --- Frost Panel --- */
.frost-panel {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(10, 40, 64, 0.6);
    border: 1px solid rgba(128, 224, 255, 0.15);
    border-radius: 8px;
    padding: 20px 24px;
    transition: border-color 0.3s ease, background 0.3s ease;
}

.frost-panel:hover {
    border-color: rgba(128, 224, 255, 0.3);
    background: rgba(10, 40, 64, 0.7);
}

.frost-label {
    display: block;
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: #40A0C0;
    margin-bottom: 10px;
}

/* --- Tech Readout --- */
.tech-readout {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: #80E0FF;
}

.readout-line {
    display: block;
    line-height: 1.8;
}

.readout-key {
    color: #40A0C0;
}

.readout-val {
    color: #C0E8F0;
    text-shadow: 0 0 8px rgba(128, 224, 255, 0.3);
}

/* =========================================================
   HERO SECTION
   ========================================================= */
#hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 60px 8vw;
    background: linear-gradient(180deg, #0A2840 0%, #041828 100%);
    z-index: 3;
    overflow: hidden;
}

#hero-content {
    position: relative;
    z-index: 5;
    opacity: 0;
    animation: heroFadeIn 1.2s ease-out 0.8s forwards;
}

@keyframes heroFadeIn {
    0% { opacity: 0; transform: translateY(30px); }
    100% { opacity: 1; transform: translateY(0); }
}

#hero-flare-burst {
    position: absolute;
    top: 50%;
    left: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(128, 224, 255, 0.5) 0%, rgba(128, 224, 255, 0.1) 40%, transparent 70%);
    transform: translate(-50%, -50%) scale(0);
    animation: heroBurst 1.5s ease-out 0.6s forwards;
    pointer-events: none;
}

@keyframes heroBurst {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; }
    40% { opacity: 0.8; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0.2; }
}

#logotype {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(48px, 8vw, 96px);
    color: #C0E8F0;
    letter-spacing: -0.02em;
    line-height: 1.1;
    text-shadow: 0 0 40px rgba(128, 224, 255, 0.2);
}

#hero-tagline {
    font-family: 'Fira Code', monospace;
    font-size: clamp(12px, 1.2vw, 16px);
    color: #40A0C0;
    letter-spacing: 3px;
    text-transform: lowercase;
    margin-top: 12px;
}

/* Floating frost panels in hero */
#frost-nav {
    position: absolute;
    top: 40px;
    right: 8vw;
    z-index: 5;
    opacity: 0;
    animation: panelDrift 1s ease-out 1.2s forwards;
}

#frost-status {
    position: absolute;
    bottom: 140px;
    right: 8vw;
    z-index: 5;
    opacity: 0;
    animation: panelDrift 1s ease-out 1.5s forwards;
}

#frost-time {
    position: absolute;
    bottom: 140px;
    left: 8vw;
    z-index: 5;
    opacity: 0;
    animation: panelDrift 1s ease-out 1.8s forwards;
}

@keyframes panelDrift {
    0% { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
}

#main-nav {
    display: flex;
    gap: 20px;
}

.nav-link {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: #C0E8F0;
    text-transform: lowercase;
    letter-spacing: 1px;
    position: relative;
    padding-bottom: 2px;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: #80E0FF;
    transition: width 0.3s ease;
}

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

.nav-link:hover {
    color: #80E0FF;
}

/* Scroll indicator */
#scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    z-index: 5;
    opacity: 0;
    animation: panelDrift 1s ease-out 2.2s forwards;
}

#scroll-indicator span {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: #40A0C0;
    letter-spacing: 3px;
    text-transform: uppercase;
}

#scroll-arrow {
    animation: scrollBounce 2s ease-in-out infinite;
}

@keyframes scrollBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(8px); }
}

/* =========================================================
   SECTIONS COMMON
   ========================================================= */
section {
    position: relative;
    z-index: 3;
}

#projects, #tech, #about, #contact {
    padding: 100px 8vw;
    background: linear-gradient(180deg, #041828 0%, #0A2840 50%, #041828 100%);
}

.section-header {
    margin-bottom: 60px;
}

.section-title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(28px, 4vw, 56px);
    color: #C0E8F0;
    letter-spacing: -0.01em;
}

.section-line {
    width: 60px;
    height: 1px;
    background: #205868;
    margin: 16px 0;
}

.section-meta {
    font-size: 12px;
    color: #40A0C0;
}

/* =========================================================
   PORTFOLIO GRID
   ========================================================= */
#portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.portfolio-card {
    position: relative;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(10, 40, 64, 0.6);
    border: 1px solid rgba(128, 224, 255, 0.15);
    border-radius: 8px;
    padding: 28px;
    transition: transform 0.3s ease-out, border-color 0.3s ease, box-shadow 0.3s ease;
    opacity: 0;
    transform: translateY(40px);
    cursor: default;
    overflow: hidden;
}

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

.portfolio-card:hover {
    border-color: rgba(128, 224, 255, 0.35);
    box-shadow: 0 0 30px rgba(128, 224, 255, 0.08);
}

.card-glow {
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at center, rgba(128, 224, 255, 0.04) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.portfolio-card:hover .card-glow {
    opacity: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.card-id {
    font-family: 'Fira Code', monospace;
    font-size: 11px;
    color: #40A0C0;
    letter-spacing: 1px;
}

.card-status {
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    padding: 3px 10px;
    border-radius: 3px;
    border: 1px solid;
}

.status-active {
    color: #80E0FF;
    border-color: rgba(128, 224, 255, 0.3);
    background: rgba(128, 224, 255, 0.08);
}

.status-complete {
    color: #40A0C0;
    border-color: rgba(64, 160, 192, 0.3);
    background: rgba(64, 160, 192, 0.08);
}

.status-wip {
    color: #C0E8F0;
    border-color: rgba(192, 232, 240, 0.2);
    background: rgba(192, 232, 240, 0.05);
}

.card-title {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(20px, 2vw, 28px);
    color: #C0E8F0;
    margin-bottom: 10px;
}

.card-desc {
    font-size: clamp(13px, 0.9vw, 15px);
    color: rgba(192, 232, 240, 0.7);
    line-height: 1.6;
    margin-bottom: 16px;
}

.card-tech-readout {
    font-family: 'Fira Code', monospace;
    font-size: 12px;
    margin-bottom: 16px;
    padding: 12px;
    background: rgba(4, 24, 40, 0.5);
    border-radius: 4px;
    border: 1px solid rgba(128, 224, 255, 0.08);
}

.card-tech-readout .readout-line {
    line-height: 1.9;
}

.card-tech-readout .readout-val {
    text-shadow: 0 0 6px rgba(128, 224, 255, 0.25);
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    color: #40A0C0;
    text-transform: lowercase;
    letter-spacing: 0.5px;
    padding: 3px 10px;
    border: 1px solid rgba(64, 160, 192, 0.25);
    border-radius: 3px;
    background: rgba(64, 160, 192, 0.05);
}

/* =========================================================
   TECH STACK
   ========================================================= */
#tech-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.tech-panel {
    padding: 28px;
}

.tech-category {
    font-family: 'DM Serif Display', serif;
    font-weight: 400;
    font-size: clamp(18px, 1.8vw, 24px);
    color: #C0E8F0;
    margin-bottom: 20px;
}

.tech-list {
    list-style: none;
}

.tech-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid rgba(32, 88, 104, 0.4);
}

.tech-list li:last-child {
    border-bottom: none;
}

.tech-name {
    font-family: 'Fira Code', monospace;
    font-size: 13px;
    color: #C0E8F0;
}

.tech-level {
    display: block;
    width: 80px;
    height: 4px;
    background: rgba(32, 88, 104, 0.5);
    border-radius: 2px;
    position: relative;
    overflow: hidden;
}

.tech-level::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, #40A0C0, #80E0FF);
    border-radius: 2px;
    transition: width 1.2s ease-out;
    box-shadow: 0 0 8px rgba(128, 224, 255, 0.3);
}

.tech-level.animated::after {
    width: var(--level);
}

/* =========================================================
   ABOUT SECTION
   ========================================================= */
#about-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

#about-panel p {
    margin-bottom: 16px;
    color: rgba(192, 232, 240, 0.8);
}

#about-panel p:last-child {
    margin-bottom: 0;
}

#about-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 24px;
}

.stat-item {
    text-align: center;
    padding: 16px;
}

.stat-value {
    display: block;
    font-family: 'DM Serif Display', serif;
    font-size: clamp(28px, 3vw, 42px);
    color: #80E0FF;
    text-shadow: 0 0 20px rgba(128, 224, 255, 0.3);
    line-height: 1.2;
}

.stat-label {
    display: block;
    font-family: 'Fira Code', monospace;
    font-size: 10px;
    color: #40A0C0;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-top: 6px;
}

/* =========================================================
   CONTACT SECTION
   ========================================================= */
#contact-content {
    max-width: 600px;
}

#contact-panel {
    padding: 36px;
}

.contact-intro {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(18px, 2vw, 24px);
    color: #C0E8F0;
    margin-bottom: 28px;
    font-weight: 400;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: 'Fira Code', monospace;
    font-size: 14px;
    color: #C0E8F0;
    padding: 12px 16px;
    border-radius: 6px;
    transition: background 0.3s ease, color 0.3s ease;
}

.contact-link:hover {
    background: rgba(128, 224, 255, 0.06);
    color: #80E0FF;
}

.contact-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Bottom readout */
#bottom-readout {
    margin-top: 80px;
    text-align: center;
    font-size: 11px;
    color: #205868;
    padding: 20px 0;
    border-top: 1px solid rgba(32, 88, 104, 0.3);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
    #portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #tech-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    #about-content {
        grid-template-columns: 1fr;
    }
}

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

    #tech-grid {
        grid-template-columns: 1fr;
    }

    #main-nav {
        flex-direction: column;
        gap: 10px;
    }

    #frost-nav {
        position: relative;
        top: auto;
        right: auto;
        margin-top: 40px;
        order: 2;
    }

    #hero {
        padding: 40px 6vw;
    }

    #frost-status,
    #frost-time {
        display: none;
    }

    #projects, #tech, #about, #contact {
        padding: 60px 6vw;
    }

    #about-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .section-title {
        font-size: clamp(24px, 6vw, 40px);
    }
}

@media (max-width: 480px) {
    #about-stats {
        grid-template-columns: 1fr;
    }

    #logotype {
        font-size: clamp(36px, 10vw, 56px);
    }
}
