/* ========================================
   ROT — Minimalist Portfolio Builder
   Design System & Portfolio Styles
   ======================================== */

@import url('https://fonts.googleapis.com/css2?family=Inconsolata:wght@300;400;500;600;700;800;900&display=swap');

/* --- Design Tokens --- */
:root {
    --bg-primary: #0a0a0a;
    --bg-surface: #111111;
    --bg-elevated: #1a1a1a;
    --bg-hover: #222222;
    --border-color: #1e1e1e;
    --border-light: #2a2a2a;

    --text-primary: #e8e6e3;
    --text-secondary: #7a7a7a;
    --text-muted: #4a4a4a;

    --accent: #b4f0c4;
    --accent-dim: #6aad7a;
    --accent-glow: rgba(180, 240, 196, 0.12);

    --font-mono: 'Inconsolata', monospace;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 50%;

    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* --- Scrollbar --- */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Firefox */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
}

body {
    font-family: var(--font-mono);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    cursor: default;
}

::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

/* --- Light Theme --- */
body.theme-light {
    --bg-primary: #f5f5f5;
    --bg-surface: #ffffff;
    --bg-elevated: #eaeaea;
    --bg-hover: #e0e0e0;
    --border-color: #e0e0e0;
    --border-light: #cccccc;

    --text-primary: #1a1a1a;
    --text-secondary: #555555;
    --text-muted: #999999;

    --accent: #2d8c4e;
    --accent-dim: #3da362;
    --accent-glow: rgba(45, 140, 78, 0.1);
}

body.theme-light ::selection {
    background: var(--accent);
    color: #ffffff;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: opacity var(--transition-fast);
}

a:hover {
    opacity: 0.8;
}

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

/* ========================================
   PORTFOLIO PAGE
   ======================================== */

.portfolio-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1;
    padding: 2rem;
    cursor: pointer;
    user-select: none;
}

.portfolio-container.expanded {
    justify-content: flex-start;
    padding-top: 4rem;
}

.portfolio-container.expanded .hero {
    animation: slideToTop 0.7s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes slideToTop {
    from {
        transform: translateY(30vh);
    }

    to {
        transform: translateY(0);
    }
}

/* --- Header Banner --- */
.header-banner {
    width: 100%;
    max-width: 520px;
    margin-bottom: 0;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    z-index: 0;
}

.header-banner.visible {
    opacity: 1;
    transform: translateY(0);
}

.header-banner a {
    display: block;
    line-height: 0;
}

.header-image {
    width: 100%;
    height: auto;
    min-height: 140px;
    max-height: 200px;
    object-fit: cover;
    border-radius: var(--radius-md) var(--radius-md) 0 0;
    border: 1px solid var(--border-color);
    border-bottom: none;
    transition: transform var(--transition-fast), filter var(--transition-fast);
}

.header-banner a[href]:not([href="#"]):hover .header-image {
    transform: scale(1.01);
    filter: brightness(1.05);
}

/* --- Hero Section (Initial View) --- */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all var(--transition-slow);
    will-change: transform;
    position: relative;
    z-index: 1;
}

/* Pull hero up to overlap header banner */
.portfolio-container.expanded .hero {
    margin-top: -55px;
}

/* Profile Picture */
.pfp-wrapper {
    position: relative;
    width: 110px;
    height: 110px;
    margin-bottom: 1.5rem;
}

.pfp-wrapper::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: var(--radius-full);
    background: linear-gradient(135deg, var(--accent-dim), transparent 60%);
    opacity: 0.5;
    transition: opacity var(--transition-smooth);
}

.pfp-wrapper:hover::before {
    opacity: 0.8;
}

.pfp {
    width: 110px;
    height: 110px;
    border-radius: var(--radius-full);
    object-fit: cover;
    position: relative;
    z-index: 1;
    filter: grayscale(20%);
    transition: filter var(--transition-smooth);
    border: 4px solid var(--bg-primary);
}

.pfp:hover {
    filter: grayscale(0%);
}

/* Name */
.hero-name {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
}

/* One-liner */
.hero-tagline {
    font-size: 0.95rem;
    font-weight: 400;
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.5;
}

/* Click Hint */
.click-hint {
    position: fixed;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: hintPulse 2.5s ease-in-out infinite;
    transition: opacity var(--transition-smooth);
    pointer-events: none;
}

.click-hint.hidden {
    opacity: 0;
}

.click-hint-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-full);
    background: var(--text-muted);
    animation: dotBounce 2.5s ease-in-out infinite;
}

@keyframes hintPulse {

    0%,
    100% {
        opacity: 0.4;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes dotBounce {

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

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

/* --- Expanded Content --- */
.expanded-content {
    width: 100%;
    max-width: 520px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(30px);
    transition: all var(--transition-slow);
    margin-top: 2.5rem;
    pointer-events: none;
}

.expanded-content.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

/* Section */
.section {
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(15px);
    transition: all 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.section-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-color);
}

/* --- Links Section --- */
.links-grid {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.link-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    font-weight: 500;
    transition: all var(--transition-fast);
    cursor: pointer;
    text-decoration: none;
}

.link-item:hover {
    background: var(--bg-elevated);
    border-color: var(--border-light);
    transform: translateX(4px);
    opacity: 1;
}

.link-item .link-icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.link-item .link-icon svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.link-item .link-label {
    flex: 1;
}

.link-item .link-arrow {
    color: var(--text-muted);
    font-size: 0.75rem;
    transition: transform var(--transition-fast);
}

.link-item:hover .link-arrow {
    transform: translateX(3px);
    color: var(--accent);
}



/* --- Gallery Section --- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.gallery-item {
    display: block;
    position: relative;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    transition: all var(--transition-fast);
}

.gallery-item:hover {
    border-color: var(--accent-dim);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.gallery-image {
    width: 100%;
    aspect-ratio: 4/3;
    /* Standard photo ratio */
    object-fit: cover;
    display: block;
    transition: transform var(--transition-smooth);
}

.gallery-item:hover .gallery-image {
    transform: scale(1.05);
}

.gallery-caption {
    padding: 0.5rem 0.6rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: var(--bg-surface);
    border-top: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Experience Section --- */
.experience-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.experience-item {
    padding: 1rem;
    border-left: 2px solid var(--border-color);
    transition: border-color var(--transition-fast);
}

.experience-item:hover {
    border-left-color: var(--accent-dim);
}

.experience-role {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.experience-company {
    font-size: 0.8rem;
    color: var(--accent-dim);
    margin-bottom: 0.25rem;
}

.experience-period {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-bottom: 0.4rem;
}

.experience-desc {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* --- Skills Section --- */
.skills-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.skill-tag {
    padding: 0.35rem 0.7rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.skill-tag:hover {
    border-color: var(--accent-dim);
    color: var(--accent);
}

/* --- Education Section --- */
.education-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.education-item {
    padding: 0.75rem 1rem;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.education-degree {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.15rem;
}

.education-school {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.education-year {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 0.15rem;
}

/* --- Resume Button --- */
.resume-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    background: transparent;
    border: 1px solid var(--accent-dim);
    border-radius: var(--radius-sm);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.resume-btn:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    transform: translateY(-1px);
    opacity: 1;
}

/* --- Footer --- */
.portfolio-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.footer-text {
    font-size: 0.65rem;
    color: var(--text-muted);
    letter-spacing: 1px;
}

.footer-text a {
    color: var(--text-muted);
    transition: color var(--transition-fast);
}

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

/* --- Empty State --- */
.empty-state {
    text-align: center;
    padding: 3rem 1rem;
}

.empty-state-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

.empty-state .setup-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1.5rem;
    background: var(--accent);
    color: var(--bg-primary);
    border: none;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition-fast);
    text-decoration: none;
}

.empty-state .setup-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px var(--accent-glow);
    opacity: 1;
}

/* --- Responsive --- */
@media (max-width: 600px) {
    .portfolio-container {
        padding: 1.5rem;
    }

    .hero-name {
        font-size: 1.4rem;
    }

    .hero-tagline {
        font-size: 0.85rem;
    }

    .pfp-wrapper {
        width: 90px;
        height: 90px;
    }

    .pfp {
        width: 90px;
        height: 90px;
    }

    .expanded-content {
        max-width: 100%;
    }
}

/* ========================================
   World Map — Portfolio
   ======================================== */
.map-display {
    width: 100%;
}

.map-svg-wrap {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
}

.world-map-svg {
    width: 100%;
    height: auto;
    display: block;
}

.wm-loading {
    padding: 3rem;
    text-align: center;
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

/* Country base styles */
.wm-country {
    fill: var(--bg-elevated);
    stroke: var(--border-light);
    stroke-width: 0.5;
    transition: fill 0.3s ease, stroke 0.3s ease, filter 0.3s ease;
    cursor: default;
}

.wm-country:hover {
    fill: var(--bg-hover);
}

/* Current location */
.wm-current {
    fill: var(--accent);
    stroke: var(--accent-dim);
    stroke-width: 1;
    filter: drop-shadow(0 0 6px var(--accent-glow));
}

.wm-current:hover {
    fill: var(--accent);
    filter: drop-shadow(0 0 10px var(--accent-glow));
}

/* Visited countries */
.wm-visited {
    fill: var(--accent-dim);
    stroke: var(--accent);
    stroke-width: 0.7;
    opacity: 0.6;
}

.wm-visited:hover {
    opacity: 0.85;
}

/* Legend */
.map-legend {
    display: flex;
    gap: 1.25rem;
    margin-top: 0.75rem;
    flex-wrap: wrap;
}

.map-legend-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.map-legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.wm-dot-current {
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent-glow);
}

.wm-dot-visited {
    background: var(--accent-dim);
    opacity: 0.6;
}

/* ========================================
   Revenue — Portfolio
   ======================================== */
.revenue-display {
    width: 100%;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
}

.revenue-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 1.25rem;
}

.revenue-total-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.revenue-total-value {
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
}

.revenue-chart-wrap {
    width: 100%;
    height: 120px;
    margin-bottom: 0.75rem;
}

.revenue-chart-wrap svg {
    width: 100%;
    height: 100%;
    display: block;
}

.revenue-chart-line {
    fill: none;
    stroke: var(--accent);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.revenue-chart-area {
    fill: url(#revenueGradient);
    opacity: 0.3;
}

.revenue-chart-dot {
    fill: var(--accent);
    r: 3;
}

.revenue-chart-grid {
    stroke: var(--border-light);
    stroke-width: 0.5;
    stroke-dasharray: 4 4;
}

.revenue-chart-label {
    fill: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 9px;
}

.revenue-providers-bar {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.revenue-provider-badge {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--text-secondary);
    padding: 0.2rem 0.5rem;
    border-radius: var(--radius-sm);
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    text-transform: lowercase;
}

/* Remove initial loading text if library leaves it */
.calendar>div:not(.js-year-contribution-container) {
    display: none;
}