/*
Theme Name: Petar Todorović — A Scientist's Mind
Theme URI: https://petartodorovic.com
Author: Petar Todorović
Author URI: https://petartodorovic.com
Description: A dark, scientific portfolio theme with 3D atomic background, scroll-driven camera movements, and a refined gold/teal aesthetic.
Version: 1.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: petar-todorovic
*/

/* =====================================================
   CSS Custom Properties
===================================================== */
:root {
    --bg-deep: #0a0d12;
    --bg-mid: #0f1419;
    --bg-card: rgba(15, 20, 25, 0.8);
    --accent-gold: #ff8c00;
    --accent-orange: #ff5500;
    --accent-ember: #ff4400;
    --accent-teal: #1a535c;
    --accent-cyan: #4ecdc4;
    --text-primary: #f5f5f5;
    --text-secondary: rgba(245, 245, 245, 0.6);
    --text-muted: rgba(245, 245, 245, 0.35);
}

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

html {
    scroll-behavior: auto;
}

body {
    font-family: 'Outfit', sans-serif;
    background: var(--bg-deep);
    color: var(--text-primary);
    overflow-x: hidden;
}

/* =====================================================
   WebGL Canvas (fixed background)
===================================================== */
#webgl-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

/* =====================================================
   Content Layer
===================================================== */
#smooth-wrapper {
    position: relative;
    z-index: 1;
}

#smooth-content {
    will-change: transform;
}

/* =====================================================
   Navigation
===================================================== */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 1.5rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 100;
    background: linear-gradient(to bottom, rgba(10, 13, 18, 0.9), transparent);
}

.nav-logo {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--text-primary);
    text-decoration: none;
    letter-spacing: 0.02em;
}

.nav-logo span {
    color: var(--accent-gold);
}

.nav-links {
    display: flex;
    gap: 2.5rem;
    list-style: none;
}

.nav-links a {
    font-size: 0.8rem;
    font-weight: 400;
    color: var(--text-secondary);
    text-decoration: none;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: var(--accent-gold);
}

/* =====================================================
   Sections
===================================================== */
.section {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding: 8rem 10%;
}

.section-content {
    max-width: 600px;
    position: relative;
    z-index: 2;
}

/* Hero Section */
.hero {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-left: 10%;
}

.hero-label {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--accent-gold);
    margin-bottom: 1.5rem;
    opacity: 0;
    transform: translateY(20px);
}

.hero-name {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2.5rem, 7vw, 5rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 1rem;
    opacity: 0;
    transform: translateY(30px);
}

.hero-tagline {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.5rem, 3vw, 2.2rem);
    font-weight: 400;
    font-style: italic;
    color: var(--accent-gold);
    margin-bottom: 2rem;
    opacity: 0;
    transform: translateY(30px);
}

.hero-role {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-secondary);
    line-height: 1.8;
    opacity: 0;
    transform: translateY(20px);
}

.hero-role .company {
    color: var(--accent-cyan);
}

.scroll-hint {
    position: absolute;
    bottom: 3rem;
    left: 10%;
    display: flex;
    align-items: center;
    gap: 1rem;
    opacity: 0;
}

.scroll-line {
    width: 60px;
    height: 1px;
    background: linear-gradient(to right, var(--accent-gold), transparent);
}

.scroll-text {
    font-size: 0.7rem;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Section Positioning */
.section-left .section-content {
    margin-right: auto;
}

.section-right .section-content {
    margin-left: auto;
    text-align: right;
}

.section-center .section-content {
    margin: 0 auto;
    text-align: center;
    max-width: 700px;
}

/* Section Typography */
.section-index {
    font-family: 'Playfair Display', serif;
    font-size: 0.9rem;
    font-style: italic;
    color: var(--accent-gold);
    margin-bottom: 1rem;
    opacity: 0.7;
}

.section-title {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 400;
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.section-title .highlight {
    color: var(--accent-gold);
    font-style: italic;
}

.section-divider {
    width: 50px;
    height: 1px;
    background: var(--accent-gold);
    margin: 1.5rem 0;
    box-shadow: 0 0 10px var(--accent-gold);
}

.section-right .section-divider {
    margin-left: auto;
}

.section-center .section-divider {
    margin: 1.5rem auto;
}

.section-text {
    font-size: 1rem;
    font-weight: 300;
    line-height: 1.8;
    color: var(--text-secondary);
}

/* =====================================================
   Credentials Block (code-style)
===================================================== */
.credentials {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    line-height: 2;
    color: var(--text-secondary);
    margin-top: 1.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border-left: 2px solid var(--accent-gold);
    backdrop-filter: blur(10px);
}

.credentials .label {
    color: var(--text-muted);
}

.credentials .value {
    color: var(--accent-cyan);
}

.credentials .institution {
    color: var(--accent-gold);
}

/* =====================================================
   Project Cards
===================================================== */
.projects-grid {
    display: grid;
    gap: 1.5rem;
    margin-top: 2rem;
}

.project-card {
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid rgba(255, 140, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.4s ease;
    text-decoration: none;
    display: block;
}

.project-card:hover {
    border-color: var(--accent-gold);
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(255, 140, 0, 0.1);
}

.project-label {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--accent-cyan);
    margin-bottom: 0.5rem;
}

.project-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.2rem;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.project-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* =====================================================
   Stats
===================================================== */
.stats {
    display: flex;
    gap: 3rem;
    margin-top: 2rem;
}

.stat {
    text-align: left;
}

.section-right .stat {
    text-align: right;
}

.stat-value {
    font-family: 'Playfair Display', serif;
    font-size: 2.5rem;
    font-weight: 400;
    color: var(--accent-gold);
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* =====================================================
   Social Links
===================================================== */
.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.section-center .social-links {
    justify-content: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-primary);
    background: transparent;
    border: 1px solid rgba(255, 140, 0, 0.3);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background: var(--accent-gold);
    color: var(--bg-deep);
    border-color: var(--accent-gold);
}

.social-link svg {
    width: 16px;
    height: 16px;
}

/* =====================================================
   CTA Button
===================================================== */
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 2rem;
    padding: 1rem 2rem;
    font-family: 'Outfit', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--bg-deep);
    background: linear-gradient(135deg, var(--accent-gold), var(--accent-orange));
    border: none;
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 10px 30px rgba(255, 140, 0, 0.25);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 40px rgba(255, 140, 0, 0.35);
}

.cta-btn svg {
    width: 16px;
    height: 16px;
    transition: transform 0.3s ease;
}

.cta-btn:hover svg {
    transform: translateX(4px);
}

/* =====================================================
   Contact Form
===================================================== */
.contact-form {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 500px;
}

.section-center .contact-form {
    margin: 2rem auto 0;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.form-input,
.form-textarea {
    padding: 1rem;
    font-family: 'Outfit', sans-serif;
    font-size: 1rem;
    color: var(--text-primary);
    background: var(--bg-card);
    border: 1px solid rgba(255, 140, 0, 0.15);
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--accent-gold);
}

.form-textarea {
    min-height: 150px;
    resize: vertical;
}

/* =====================================================
   Footer
===================================================== */
.footer {
    padding: 3rem 10%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid rgba(255, 140, 0, 0.1);
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

/* =====================================================
   Loading Screen
===================================================== */
.loader {
    position: fixed;
    inset: 0;
    background: var(--bg-deep);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 1s ease, visibility 1s ease;
}

.loader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader-atom {
    width: 60px;
    height: 60px;
    position: relative;
}

.loader-orbit {
    position: absolute;
    width: 100%;
    height: 100%;
    border: 1px solid var(--accent-gold);
    border-radius: 50%;
    animation: spin 1.5s linear infinite;
}

.loader-orbit:nth-child(2) {
    transform: rotateX(60deg) rotateY(20deg);
    animation-duration: 2s;
    border-color: var(--accent-orange);
}

.loader-orbit:nth-child(3) {
    transform: rotateX(-60deg) rotateY(-20deg);
    animation-duration: 1s;
    border-color: var(--accent-cyan);
}

.loader-core {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: var(--accent-gold);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--accent-gold);
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loader-text {
    margin-top: 1.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.4em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* =====================================================
   WordPress Default Styles (required)
===================================================== */
.wp-block-image img { max-width: 100%; height: auto; }
.alignleft { float: left; margin-right: 1rem; }
.alignright { float: right; margin-left: 1rem; }
.aligncenter { display: block; margin: 0 auto; }

/* =====================================================
   Responsive
===================================================== */
@media (max-width: 768px) {
    .nav-links {
        display: none;
    }

    .section {
        padding: 6rem 6%;
    }

    .hero {
        padding-left: 6%;
    }

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

    .section-right .section-content,
    .section-right .stat {
        text-align: left;
    }

    .section-right .section-divider {
        margin-left: 0;
    }

    .footer {
        flex-direction: column;
        text-align: center;
    }
}
