/* =========================================================
   RANUK.DEV — Portfolio Styles
   Author: Emilio Ranucoli
   ========================================================= */

/* ---- CSS Variables ---- */
:root {
    --bg-primary: #0a0a1a;
    --bg-secondary: #0f0f23;
    --bg-card: #151530;
    --bg-card-hover: #1a1a3e;
    --accent: #64ffda;
    --accent-dim: rgba(100, 255, 218, 0.1);
    --accent-secondary: #f97316;
    --accent-secondary-dim: rgba(249, 115, 22, 0.1);
    --text-primary: #ccd6f6;
    --text-secondary: #8892b0;
    --text-bright: #e6f1ff;
    --border: rgba(100, 255, 218, 0.15);
    --nav-height: 70px;
    --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Fira Code', 'Consolas', monospace;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    --shadow-accent: 0 0 20px rgba(100, 255, 218, 0.15);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    scrollbar-width: thin;
    scrollbar-color: var(--accent) var(--bg-secondary);
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

body {
    font-family: var(--font-main);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    overflow-x: hidden;
    cursor: none;
}

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

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

a:hover { color: var(--text-bright); }

img {
    max-width: 100%;
    display: block;
}

ul { list-style: none; }

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* ---- Preloader ---- */
#preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#preloader.loaded {
    opacity: 0;
    visibility: hidden;
}

.loader {
    width: 500px;
    max-width: 90vw;
}

.loader-terminal {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
}

.loader-terminal .terminal-header {
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.03);
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--border);
}

.loader-terminal .terminal-body {
    padding: 20px;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}

.loader-line {
    opacity: 0;
    animation: fadeInLine 0.4s ease forwards;
    animation-delay: calc(var(--delay) * 0.6s);
    margin-bottom: 8px;
    color: var(--text-secondary);
}

.loader-line .prompt {
    color: var(--accent);
    margin-right: 8px;
}

.loader-line .success {
    color: #4ade80;
}

.loader-line .blink {
    animation: blinkCursor 0.8s infinite;
    color: var(--accent);
}

@keyframes fadeInLine {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes blinkCursor {
    0%, 50% { opacity: 1; }
    51%, 100% { opacity: 0; }
}

/* ---- Custom Cursor ---- */
.custom-cursor {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9999;
    transition: transform 0.1s ease;
    mix-blend-mode: difference;
}

.cursor-follower {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--accent);
    border-radius: 50%;
    position: fixed;
    pointer-events: none;
    z-index: 9998;
    transition: transform 0.15s ease, width 0.3s, height 0.3s, border-color 0.3s;
    transform: translate(-50%, -50%);
}

.cursor-follower.hover {
    width: 50px;
    height: 50px;
    border-color: var(--accent-secondary);
    background: rgba(100, 255, 218, 0.05);
}

@media (pointer: coarse) {
    .custom-cursor,
    .cursor-follower { display: none; }
    body { cursor: auto; }
}

/* ---- Dot indicators ---- */
.terminal-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.terminal-dot.red { background: #ff5f57; }
.terminal-dot.yellow { background: #febc2e; }
.terminal-dot.green { background: #28c840; }

/* ---- Navigation ---- */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: var(--nav-height);
    z-index: 1000;
    transition: var(--transition);
    backdrop-filter: blur(0px);
}

.navbar.scrolled {
    background: rgba(10, 10, 26, 0.9);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--font-mono);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text-bright);
    cursor: none;
}

.logo-bracket {
    color: var(--accent);
    font-weight: 400;
}

.logo-text {
    margin: 0 2px;
}

.nav-menu {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    position: relative;
    cursor: none;
    padding: 4px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent);
}

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

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.lang-switcher {
    display: flex;
    gap: 4px;
    background: var(--bg-secondary);
    padding: 3px;
    border-radius: 6px;
    border: 1px solid var(--border);
}

.lang-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 4px;
    cursor: none;
    transition: var(--transition);
}

.lang-btn:hover { color: var(--text-primary); }

.lang-btn.active {
    background: var(--accent);
    color: var(--bg-primary);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: none;
    padding: 4px;
}

.nav-toggle span {
    width: 24px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: var(--transition);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.active span:nth-child(2) { opacity: 0; }

.nav-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ---- Hero Section ---- */
.hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    padding-top: var(--nav-height);
}

#particles-canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 2rem;
}

.hero-greeting {
    font-family: var(--font-mono);
    font-size: 1rem;
    color: var(--accent);
    margin-bottom: 1rem;
    letter-spacing: 1px;
}

.hero-tag {
    color: var(--accent);
    opacity: 0.6;
}

.hero-name {
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 900;
    color: var(--text-bright);
    letter-spacing: -1px;
    line-height: 1.1;
    margin-bottom: 1rem;
    position: relative;
}

/* Glitch effect */
.glitch {
    position: relative;
    animation: glitchShift 8s infinite;
}

.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.glitch::before {
    color: var(--accent);
    animation: glitchTop 3s infinite linear alternate-reverse;
    clip-path: inset(0 0 65% 0);
    transform: translate(-2px, -2px);
    opacity: 0.8;
}

.glitch::after {
    color: var(--accent-secondary);
    animation: glitchBottom 2.5s infinite linear alternate-reverse;
    clip-path: inset(65% 0 0 0);
    transform: translate(2px, 2px);
    opacity: 0.8;
}

@keyframes glitchShift {
    0%, 90%, 100% { transform: translate(0); }
    92% { transform: translate(-2px, 1px); }
    94% { transform: translate(2px, -1px); }
    96% { transform: translate(-1px, 2px); }
    98% { transform: translate(1px, -2px); }
}

@keyframes glitchTop {
    0%, 85%, 100% { clip-path: inset(0 0 65% 0); transform: translate(0); }
    87% { clip-path: inset(10% 0 55% 0); transform: translate(-3px); }
    90% { clip-path: inset(20% 0 45% 0); transform: translate(3px); }
    93% { clip-path: inset(0 0 65% 0); transform: translate(0); }
}

@keyframes glitchBottom {
    0%, 80%, 100% { clip-path: inset(65% 0 0 0); transform: translate(0); }
    83% { clip-path: inset(55% 0 10% 0); transform: translate(3px); }
    86% { clip-path: inset(45% 0 20% 0); transform: translate(-3px); }
    89% { clip-path: inset(65% 0 0 0); transform: translate(0); }
}

.hero-subtitle {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    color: var(--accent);
    margin-bottom: 1.5rem;
    min-height: 1.5em;
}

.typed-prefix {
    color: var(--accent-secondary);
    opacity: 0.7;
}

.typed-cursor {
    animation: blinkCursor 0.8s infinite;
    font-weight: 100;
    color: var(--accent);
}

.hero-description {
    max-width: 600px;
    margin: 0 auto 2rem;
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.8;
}

.hero-cta {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 3rem;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    cursor: none;
    transition: var(--transition);
    text-decoration: none;
}

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

.btn-primary:hover {
    background: var(--text-bright);
    color: var(--bg-primary);
    box-shadow: var(--shadow-accent);
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--accent);
    border: 1.5px solid var(--accent);
}

.btn-outline:hover {
    background: var(--accent-dim);
    color: var(--accent);
    transform: translateY(-2px);
}

/* ---- Hero Stats ---- */
.hero-stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    flex-wrap: wrap;
    margin-bottom: 4rem;
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 2.2rem;
    font-weight: 800;
    color: var(--accent);
    font-family: var(--font-mono);
}

.stat-plus {
    font-size: 1.5rem;
    color: var(--accent);
    font-weight: 700;
}

.stat-label {
    display: block;
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ---- Scroll Indicator ---- */
.scroll-indicator {
    position: absolute;
    bottom: 1rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    animation: floatUp 2s ease-in-out infinite;
    cursor: none;
}

.mouse {
    width: 24px;
    height: 38px;
    border: 2px solid var(--text-secondary);
    border-radius: 12px;
    position: relative;
}

.wheel {
    width: 3px;
    height: 8px;
    background: var(--accent);
    border-radius: 2px;
    position: absolute;
    top: 6px;
    left: 50%;
    transform: translateX(-50%);
    animation: scrollWheel 2s ease infinite;
}

@keyframes scrollWheel {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(12px); }
}

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

/* ---- Sections ---- */
.section {
    padding: 100px 0;
    position: relative;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 3rem;
    text-align: center;
}

.title-number {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 400;
    margin-right: 8px;
}

.section-subtitle {
    text-align: center;
    color: var(--text-secondary);
    max-width: 600px;
    margin: -1.5rem auto 3rem;
    font-size: 1rem;
}

/* ---- About Section ---- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.about-text p {
    color: var(--text-secondary);
    margin-bottom: 1.2rem;
    font-size: 0.95rem;
    line-height: 1.8;
}

.about-text strong {
    color: var(--accent);
    font-weight: 600;
}

.about-text em {
    color: var(--accent-secondary);
    font-style: italic;
}

.about-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2rem;
}

.detail-item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.detail-item i {
    color: var(--accent);
    font-size: 1rem;
    width: 20px;
    text-align: center;
}

.about-image {
    display: flex;
    justify-content: center;
}

.image-wrapper {
    position: relative;
    width: 300px;
    aspect-ratio: 3 / 4;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    border-radius: 8px;
    position: relative;
    z-index: 1;
    filter: grayscale(20%) contrast(1.05);
    transition: var(--transition);
}

.image-wrapper:hover img {
    filter: grayscale(0%) contrast(1.1);
}

.image-border {
    position: absolute;
    top: 18px;
    left: 18px;
    width: 100%;
    height: 100%;
    border: 2px solid var(--accent);
    border-radius: 8px;
    z-index: 0;
    transition: var(--transition);
}

.image-wrapper:hover .image-border {
    top: 12px;
    left: 12px;
}

/* ---- Skills Section ---- */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
}

.skill-category {
    background: var(--bg-secondary);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.skill-category:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
    transform: translateY(-4px);
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 1.5rem;
}

.category-header i {
    color: var(--accent);
    font-size: 1.3rem;
}

.category-header h3 {
    color: var(--text-bright);
    font-size: 1.1rem;
    font-weight: 600;
}

.skill-bars {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-bar {
    width: 100%;
}

.skill-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.skill-info span:last-child {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.skill-progress {
    height: 6px;
    background: rgba(100, 255, 218, 0.08);
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary));
    border-radius: 3px;
    width: 0;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.progress-fill.animated {
    width: var(--target-width);
}

/* ---- Experience Section ---- */
.experience {
    background: var(--bg-secondary);
}

.timeline {
    position: relative;
    max-width: 900px;
    margin: 0 auto;
    padding-left: 40px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-secondary), transparent);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
    opacity: 0;
    transform: translateX(-20px);
    transition: all 0.6s ease;
}

.timeline-item.visible {
    opacity: 1;
    transform: translateX(0);
}

.timeline-marker {
    position: absolute;
    left: -46px;
    top: 8px;
    width: 14px;
    height: 14px;
    background: var(--bg-primary);
    border: 2px solid var(--accent);
    border-radius: 50%;
    z-index: 1;
    transition: var(--transition);
}

.timeline-item:hover .timeline-marker {
    background: var(--accent);
    box-shadow: 0 0 12px var(--accent);
}

.timeline-content {
    background: var(--bg-card);
    padding: 1.8rem;
    border-radius: 10px;
    border: 1px solid var(--border);
    transition: var(--transition);
}

.timeline-content:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow-accent);
}

.timeline-header h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-bright);
    margin-bottom: 4px;
}

.timeline-company {
    display: block;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.timeline-location,
.timeline-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin-right: 1rem;
}

.timeline-location i,
.timeline-date i {
    margin-right: 4px;
    font-size: 0.75rem;
}

.timeline-details {
    margin-top: 1rem;
    padding-left: 1rem;
}

.timeline-details li {
    color: var(--text-secondary);
    font-size: 0.88rem;
    margin-bottom: 0.5rem;
    position: relative;
    padding-left: 1rem;
    line-height: 1.6;
}

.timeline-details li::before {
    content: '>';
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: var(--font-mono);
    font-weight: 700;
}

.timeline-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 1rem;
}

.timeline-tags span {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-family: var(--font-mono);
    font-weight: 500;
}

/* ---- Projects Section ---- */
.project-filters {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.filter-btn {
    background: none;
    border: 1.5px solid var(--border);
    color: var(--text-secondary);
    padding: 8px 20px;
    border-radius: 6px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    cursor: none;
    transition: var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.project-card {
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: var(--transition);
    opacity: 0;
    transform: translateY(30px);
}

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

.project-card.hidden {
    display: none;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-8px);
    box-shadow: var(--shadow-accent);
}

.project-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.project-placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-card), var(--bg-primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--accent, #64ffda);
    transition: var(--transition);
}

.project-placeholder i {
    color: var(--accent, #64ffda);
    opacity: 0.6;
    transition: var(--transition);
}

.project-card:hover .project-placeholder i {
    opacity: 1;
    transform: scale(1.2);
}

.project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 26, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.project-card:hover .project-overlay {
    opacity: 1;
}

.project-overlay .project-links {
    display: flex;
    gap: 1rem;
}

.project-overlay .project-links a {
    width: 50px;
    height: 50px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1.2rem;
    transition: var(--transition);
    cursor: none;
}

.project-overlay .project-links a:hover {
    background: var(--accent);
    color: var(--bg-primary);
}

.project-info {
    padding: 1.5rem;
}

.project-info h3 {
    color: var(--text-bright);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.project-info p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.project-tech {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.project-tech span {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 0.72rem;
    font-family: var(--font-mono);
}

.projects-cta {
    text-align: center;
    margin-top: 3rem;
}

/* ---- ML Lab Section ---- */
.ml-lab {
    background: var(--bg-secondary);
}

.ml-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    background: var(--bg-card);
    border-radius: 12px;
    padding: 2rem;
    border: 1px solid var(--border);
}

.ml-canvas-wrapper {
    position: relative;
    background: var(--bg-primary);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

#ml-canvas {
    width: 100%;
    height: 100%;
    min-height: 400px;
    cursor: crosshair;
    display: block;
}

.ml-canvas-hint {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    pointer-events: none;
    opacity: 0.6;
    transition: var(--transition);
}

.ml-canvas-hint.hidden { opacity: 0; }

.ml-controls {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.ml-control-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ml-control-group label {
    color: var(--text-secondary);
    font-size: 0.82rem;
    font-family: var(--font-mono);
}

.class-selector {
    display: flex;
    gap: 8px;
}

.class-btn {
    flex: 1;
    padding: 10px;
    background: rgba(100, 255, 218, 0.05);
    border: 1.5px solid var(--border);
    border-radius: 6px;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.82rem;
    cursor: none;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.class-btn.active {
    border-color: var(--class-color, var(--accent));
    color: var(--class-color, var(--accent));
    background: rgba(100, 255, 218, 0.1);
}

.class-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* Range inputs */
input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    background: rgba(100, 255, 218, 0.15);
    border-radius: 2px;
    outline: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: none;
    border: none;
}

input[type="range"]::-moz-range-thumb {
    width: 16px;
    height: 16px;
    background: var(--accent);
    border-radius: 50%;
    cursor: none;
    border: none;
}

.ml-control-group span:last-child {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--accent);
    text-align: right;
}

.ml-buttons {
    display: flex;
    gap: 0.8rem;
}

.ml-buttons .btn {
    flex: 1;
    justify-content: center;
    padding: 10px 16px;
    font-size: 0.85rem;
}

.ml-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 0.8rem;
    margin-top: auto;
}

.ml-stat {
    background: var(--bg-primary);
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    border: 1px solid var(--border);
}

.ml-stat span:first-child {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    margin-bottom: 4px;
    text-transform: uppercase;
}

.ml-stat span:last-child {
    display: block;
    font-size: 1rem;
    color: var(--accent);
    font-weight: 700;
    font-family: var(--font-mono);
}

/* ---- Certifications Section ---- */
.certs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 1.2rem;
}

.cert-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: var(--transition);
    opacity: 0;
    transform: translateY(20px);
}

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

.cert-card:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: var(--shadow-accent);
}

.cert-icon {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.cert-card h3 {
    color: var(--text-bright);
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cert-code {
    display: inline-block;
    background: var(--accent-dim);
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.cert-issuer {
    display: block;
    color: var(--text-secondary);
    font-size: 0.82rem;
    margin-bottom: 2px;
}

.cert-year {
    display: block;
    color: var(--accent-secondary);
    font-family: var(--font-mono);
    font-size: 0.78rem;
    font-weight: 600;
}

/* ---- Contact Section ---- */
.contact {
    background: var(--bg-secondary);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
}

.contact-text p {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
    margin-bottom: 2rem;
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.contact-link {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
}

.contact-link:hover {
    color: var(--accent);
    border-color: var(--border);
    background: var(--accent-dim);
}

.contact-link i {
    color: var(--accent);
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

/* Contact Form */
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    position: relative;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    resize: vertical;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.form-group label {
    position: absolute;
    left: 16px;
    top: 14px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: var(--transition);
    pointer-events: none;
    background: var(--bg-card);
    padding: 0 4px;
}

.form-group input:focus + label,
.form-group input:valid + label,
.form-group textarea:focus + label,
.form-group textarea:valid + label {
    top: -10px;
    left: 12px;
    font-size: 0.75rem;
    color: var(--accent);
}

.form-line {
    display: none;
}

.contact-form .btn {
    align-self: flex-start;
}

/* ---- Footer ---- */
.footer {
    padding: 3rem 0 2rem;
    border-top: 1px solid var(--border);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.footer-social {
    display: flex;
    gap: 1.2rem;
}

.footer-social a {
    width: 44px;
    height: 44px;
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: var(--transition);
    cursor: none;
}

.footer-social a:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-dim);
    transform: translateY(-3px);
}

.footer-text {
    color: var(--text-secondary);
    font-size: 0.85rem;
}

.footer-text a {
    color: var(--accent);
    font-weight: 600;
}

.footer-copy {
    color: var(--text-secondary);
    font-size: 0.78rem;
    text-align: center;
    opacity: 0.6;
}

/* ---- Ranuk Development Section ---- */
.ranuk-dev {
    background: var(--bg-secondary);
}

.ranuk-hero {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 3rem;
    align-items: center;
    margin-bottom: 3rem;
}

.ranuk-logo {
    width: 320px;
    max-width: 100%;
    height: auto;
}

.ranuk-tagline {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 1rem;
    font-family: var(--font-mono);
}

.ranuk-description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.8;
}

.ranuk-values {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.value-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2rem;
    text-align: center;
    transition: var(--transition);
}

.value-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-accent);
}

.value-card i {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 1rem;
}

.value-card h4 {
    color: var(--text-bright);
    font-size: 1.05rem;
    margin-bottom: 0.8rem;
}

.value-card p {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.7;
}

.ranuk-clients-title {
    text-align: center;
    color: var(--text-bright);
    font-size: 1.3rem;
    margin-bottom: 2rem;
}

.ranuk-projects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
}

.ranuk-project-card {
    display: flex;
    gap: 1.2rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 1.5rem;
    transition: var(--transition);
    color: var(--text-primary);
    text-decoration: none;
    cursor: none;
}

.ranuk-project-card:hover {
    border-color: var(--accent);
    transform: translateY(-4px);
    box-shadow: var(--shadow-accent);
    color: var(--text-primary);
}

.ranuk-project-icon {
    width: 56px;
    height: 56px;
    min-width: 56px;
    border-radius: 12px;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--project-accent, var(--accent));
    border: 1px solid rgba(100, 255, 218, 0.1);
}

.ranuk-project-info h4 {
    color: var(--text-bright);
    font-size: 1.05rem;
    margin-bottom: 2px;
}

.ranuk-project-url {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--accent);
    display: block;
    margin-bottom: 0.5rem;
}

.ranuk-project-info p {
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.6;
    margin-bottom: 0.8rem;
}

/* ---- Ranuk Process Steps (Redesigned) ---- */
.ranuk-process {
    margin-top: 4rem;
}

.ranuk-timeline-steps {
    display: flex;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    margin-bottom: 1rem;
}

.ranuk-step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    position: relative;
    transition: var(--transition);
    flex: 1;
    max-width: 320px;
}

.ranuk-step-card:hover {
    border-color: var(--accent);
    transform: translateY(-6px);
    box-shadow: 0 8px 30px rgba(100, 255, 218, 0.12);
}

.step-badge {
    position: absolute;
    top: -16px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, var(--accent), var(--accent-secondary));
    color: var(--bg-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    font-weight: 800;
    padding: 6px 18px;
    border-radius: 24px;
    letter-spacing: 2px;
    box-shadow: 0 4px 15px rgba(100, 255, 218, 0.3);
}

.step-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(100, 255, 218, 0.08);
    border: 2px solid rgba(100, 255, 218, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0.5rem auto 1.2rem;
    font-size: 1.5rem;
    color: var(--accent);
    transition: var(--transition);
}

.ranuk-step-card:hover .step-icon-circle {
    background: rgba(100, 255, 218, 0.15);
    border-color: var(--accent);
    transform: scale(1.1);
}

.step-connector {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.8rem;
    margin-top: 4rem;
    color: var(--accent);
    font-size: 1.2rem;
    opacity: 0.5;
}

.ranuk-step-card h4 {
    color: var(--text-bright);
    font-size: 1.1rem;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.ranuk-step-card p {
    color: var(--text-secondary);
    font-size: 0.88rem;
    line-height: 1.7;
}

/* ---- Ranuk CTA ---- */
.ranuk-cta {
    margin-top: 3rem;
    text-align: center;
    padding: 3.5rem 2.5rem;
    background: linear-gradient(135deg, rgba(100, 255, 218, 0.06), rgba(249, 115, 22, 0.06));
    border: 1px solid var(--border);
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

.ranuk-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-secondary), var(--accent));
    background-size: 200% auto;
    animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
    0% { background-position: -200% center; }
    100% { background-position: 200% center; }
}

.cta-icon {
    font-size: 2.5rem;
    color: var(--accent-secondary);
    margin-bottom: 1rem;
}

.ranuk-cta h3 {
    font-size: 2rem;
    color: var(--text-bright);
    margin-bottom: 1rem;
    font-weight: 700;
}

.ranuk-cta p {
    color: var(--text-secondary);
    font-size: 1.05rem;
    max-width: 520px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.ranuk-cta-buttons {
    display: flex;
    gap: 1.2rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-glow {
    box-shadow: 0 0 20px rgba(100, 255, 218, 0.2);
    transition: box-shadow 0.3s ease;
}

.btn-glow:hover {
    box-shadow: 0 0 30px rgba(100, 255, 218, 0.4);
}

/* ---- Featured Cert Card ---- */
.cert-card.featured {
    border-color: var(--accent);
    background: linear-gradient(135deg, var(--bg-secondary), var(--bg-card));
    box-shadow: 0 0 15px rgba(100, 255, 218, 0.1);
}

/* ---- Reveal Animations ---- */
.reveal-element {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal-element.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Responsive Design ---- */
@media (max-width: 1024px) {
    .about-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-image {
        order: -1;
    }

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

    .ml-container {
        grid-template-columns: 1fr;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .ranuk-hero {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .ranuk-values {
        grid-template-columns: 1fr;
    }

    .ranuk-timeline-steps {
        flex-direction: column;
        align-items: center;
        gap: 2.5rem;
    }

    .ranuk-step-card {
        max-width: 100%;
    }

    .step-connector {
        transform: rotate(90deg);
        margin-top: 0;
        padding: 0;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        height: calc(100vh - var(--nav-height));
        background: rgba(10, 10, 26, 0.97);
        backdrop-filter: blur(20px);
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 2rem;
        transform: translateX(100%);
        transition: transform 0.4s ease;
    }

    .nav-menu.open {
        transform: translateX(0);
    }

    .nav-link {
        font-size: 1.2rem;
    }

    .nav-toggle {
        display: flex;
    }

    .hero-name {
        font-size: clamp(2rem, 10vw, 3.5rem);
    }

    .hero-stats {
        gap: 1.5rem;
    }

    .stat-number {
        font-size: 1.8rem;
    }

    .section {
        padding: 60px 0;
    }

    .section-title {
        font-size: 1.5rem;
    }

    .about-details {
        grid-template-columns: 1fr;
    }

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

    .certs-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    .ranuk-projects {
        grid-template-columns: 1fr;
    }

    .ranuk-project-card {
        flex-direction: column;
        text-align: center;
    }

    .ranuk-project-icon {
        margin: 0 auto;
    }

    .timeline {
        padding-left: 30px;
    }

    .timeline-marker {
        left: -36px;
    }

    .ml-stats {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 1rem;
    }

    .hero-cta {
        flex-direction: column;
        align-items: center;
    }

    .hero-stats {
        flex-direction: column;
        gap: 1rem;
    }

    .project-filters {
        gap: 0.3rem;
    }

    .filter-btn {
        padding: 6px 14px;
        font-size: 0.75rem;
    }

    .ml-container {
        padding: 1rem;
    }

    #ml-canvas {
        min-height: 300px;
    }

    .class-selector {
        flex-direction: column;
    }
}

/* ---- Print ---- */
@media print {
    .navbar,
    #preloader,
    .custom-cursor,
    .cursor-follower,
    .scroll-indicator,
    #particles-canvas { display: none; }

    body {
        background: #fff;
        color: #000;
        cursor: auto;
    }

    .section { padding: 20px 0; }
}
