/* JRF LAB - Interactive Design System v2 */

:root {
    --bg-dark: #0A0A0A;
    --bg-card: #151515;
    --copper: #C5A06F;
    --copper-dark: #A3845C;
    --copper-light: #E8C99B;
    --text-white: #FFFFFF;
    --text-gray: #B0B0B0;
    --accent-glow: rgba(197, 160, 111, 0.15);
    --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-white);
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
    cursor: none;
}

body.is-loading { overflow: hidden; }

a, button { cursor: none; }

/* ── Loader ── */
#page-loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--bg-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.6s var(--ease-out-expo), visibility 0.6s;
}

#page-loader.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-inner { text-align: center; width: 220px; }

.loader-logo {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -1px;
    display: block;
    margin-bottom: 2rem;
}

.loader-bar {
    height: 2px;
    background: rgba(255,255,255,0.08);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.loader-fill {
    display: block;
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--copper-dark), var(--copper-light));
    border-radius: 2px;
}

.loader-pct {
    font-size: 0.75rem;
    color: var(--text-gray);
    font-family: 'JetBrains Mono', monospace;
}

/* ── Custom Cursor ── */
#cursor-dot, #cursor-ring {
    position: fixed;
    top: 0; left: 0;
    pointer-events: none;
    z-index: 10001;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    will-change: transform;
}

#cursor-dot {
    width: 6px; height: 6px;
    background: var(--copper);
}

#cursor-ring {
    width: 36px; height: 36px;
    border: 1px solid rgba(197, 160, 111, 0.5);
    transition: width 0.3s, height 0.3s, border-color 0.3s, background 0.3s;
}

#cursor-ring.hovering {
    width: 56px; height: 56px;
    border-color: var(--copper);
    background: rgba(197, 160, 111, 0.08);
}

/* ── Scroll Progress ── */
#scroll-progress {
    position: fixed;
    top: 0; left: 0;
    height: 2px;
    width: 0%;
    background: linear-gradient(90deg, var(--copper-dark), var(--copper-light));
    z-index: 10002;
    box-shadow: 0 0 12px var(--accent-glow);
}

/* ── Ambient Layers ── */
#ambient-layer, #webgl-layer {
    position: fixed;
    inset: 0;
    pointer-events: none;
}

#ambient-layer { z-index: 0; }
#webgl-layer { z-index: 1; }

#particles-canvas, #hero-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

#grain-overlay {
    position: absolute;
    inset: 0;
    opacity: 0.04;
    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)'/%3E%3C/svg%3E");
    animation: grain 0.5s steps(2) infinite;
}

@keyframes grain {
    0%, 100% { transform: translate(0,0); }
    50% { transform: translate(-2%, -2%); }
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: orbFloat 12s ease-in-out infinite;
}

.glow-orb-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(197,160,111,0.25), transparent 70%);
    top: -10%; right: -5%;
}

.glow-orb-2 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(100,80,200,0.12), transparent 70%);
    bottom: 10%; left: -10%;
    animation-delay: -6s;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -40px) scale(1.1); }
}

header, main, footer {
    position: relative;
    z-index: 5;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 2rem; }
.container-sm { max-width: 800px; }
.copper { color: var(--copper); }

.gradient-text {
    background: linear-gradient(135deg, var(--copper-light), var(--copper), var(--copper-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ── Header ── */
header {
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(10, 10, 10, 0.55);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
}

header.scrolled {
    background: rgba(10, 10, 10, 0.92);
    border-bottom-color: rgba(197, 160, 111, 0.15);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 72px;
    gap: 2rem;
}

.nav-brand {
    text-decoration: none;
    color: var(--text-white);
    font-weight: 800;
    font-size: 1.35rem;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    transition: opacity 0.25s;
}

.nav-brand:hover { opacity: 0.85; }

.nav-links {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 2.75rem;
    margin-left: auto;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 500;
    font-size: 0.9rem;
    letter-spacing: 0.02em;
    transition: color 0.25s;
    position: relative;
    padding: 0.25rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--copper);
    transition: width 0.3s var(--ease-out-expo);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-white);
}

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

.nav-links a.active {
    color: var(--copper);
}

.nav-cta {
    color: var(--copper) !important;
    font-weight: 600 !important;
}

.nav-cta::after {
    background: var(--copper) !important;
}

.menu-toggle {
    display: none;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    padding: 8px;
    z-index: 1001;
}

.menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-white);
    transition: var(--transition);
}

.menu-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 6px); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -6px); }

.mobile-nav {
    position: fixed;
    inset: 0;
    z-index: 999;
    background: rgba(10,10,10,0.97);
    backdrop-filter: blur(20px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
}

.mobile-nav.open { opacity: 1; visibility: visible; }

.mobile-nav a {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--text-white);
    text-decoration: none;
    transition: color 0.3s;
}

.mobile-nav a:hover { color: var(--copper); }

/* ── Hero ── */
.hero-section {
    padding-top: clamp(7.5rem, 14vh, 10rem);
    padding-bottom: 0;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
}

.hero-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 2.5rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.1fr 0.9fr;
    gap: clamp(3rem, 6vw, 6rem);
    align-items: center;
}

.hero-content {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
    z-index: 3;
}

.hero-visual {
    position: relative;
    z-index: 3;
}

.badge {
    background: var(--accent-glow);
    color: var(--copper);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.8rem;
    font-weight: 600;
    display: inline-block;
    border: 1px solid rgba(197, 160, 111, 0.3);
    margin-bottom: 1.75rem;
    width: fit-content;
}

h1 {
    font-size: clamp(2.4rem, 5vw, 4.2rem);
    line-height: 1.08;
    font-weight: 800;
    margin-bottom: 1.75rem;
    letter-spacing: -2px;
}

.split-heading .line { display: block; overflow: hidden; }

.hero-desc {
    font-size: 1.1rem;
    color: var(--text-gray);
    margin-bottom: 2.5rem;
    max-width: 520px;
    line-height: 1.75;
}

.hero-btns {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem 1.5rem;
}

.scroll-hint {
    position: absolute;
    bottom: -2.5rem;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    opacity: 0.35;
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    pointer-events: none;
}

.scroll-line {
    width: 1px;
    height: 40px;
    background: linear-gradient(to bottom, var(--copper), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { transform: scaleY(0.5); opacity: 0.3; }
    50% { transform: scaleY(1); opacity: 1; }
}

/* ── Tech Strip (estática, transparente) ── */
.tech-strip {
    width: 100%;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    padding: 1.75rem 0 2.25rem;
    background: transparent;
    position: relative;
    z-index: 3;
    margin-top: auto;
}

.tech-strip-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.75rem 1.25rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.tech-strip-inner span:not(.sep) { color: var(--copper); }
.tech-strip-inner .sep { color: rgba(255, 255, 255, 0.2); }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background-color: var(--copper);
    color: #000;
    border: 1px solid var(--copper);
}

.glow-btn::before {
    content: '';
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--copper-light), var(--copper-dark));
    border-radius: 10px;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s;
    filter: blur(12px);
}

.glow-btn:hover::before { opacity: 0.6; }

.btn-primary:hover {
    background-color: var(--copper-dark);
    color: #000 !important;
    transform: translateY(-3px);
}

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

.btn-outline:hover {
    background: var(--copper);
    color: #000 !important;
}

.btn-link { color: var(--text-white); padding: 0 1rem; }
.btn-link:hover { color: var(--copper); }
.btn-link:hover .fa-arrow-right { transform: translateX(4px); }
.btn-link .fa-arrow-right {
    transition: transform 0.3s var(--ease-out-expo);
    display: inline-block;
}

/* ── Code Card ── */
.code-card {
    background: rgba(13, 13, 13, 0.85);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 24px 48px rgba(0,0,0,0.5);
    font-family: 'JetBrains Mono', monospace;
    position: relative;
    overflow: hidden;
    transform-style: preserve-3d;
    will-change: transform;
}

.code-glow {
    position: absolute;
    inset: -50%;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(197,160,111,0.12), transparent 50%);
    pointer-events: none;
}

.code-header {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    align-items: center;
}

.code-filename {
    margin-left: auto;
    font-size: 0.7rem;
    color: var(--text-gray);
}

.dot { width: 12px; height: 12px; border-radius: 50%; }
.dot-red { background: #ff5f56; }
.dot-yellow { background: #ffbd2e; }
.dot-green { background: #27c93f; }

code {
    font-size: 0.82rem;
    color: #f8f8f2;
    white-space: pre-wrap;
    word-break: break-word;
    position: relative;
    z-index: 1;
}

.code-card .blue { color: #66d9ef; }
.code-card .green { color: #a6e22e; }
.code-card .orange { color: #fd971f; }
.code-card .yellow { color: #e6db74; }

.scan-line {
    position: absolute;
    left: 0; right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(197,160,111,0.4), transparent);
    animation: scanLine 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes scanLine {
    0% { top: 0; opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { top: 100%; opacity: 0; }
}

/* ── Tilt Cards ── */
.tilt-card {
    transform-style: preserve-3d;
    will-change: transform;
    transition: box-shadow 0.35s;
}

.card-shine {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(197,160,111,0.08), transparent 60%);
    opacity: 0;
    transition: opacity 0.35s;
    pointer-events: none;
}

.tilt-card:hover .card-shine { opacity: 1; }

/* ── Sections ── */
.section-tag {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.75rem;
    color: var(--copper);
    margin-bottom: 0.75rem;
    letter-spacing: 1px;
}

.section-title { margin-bottom: clamp(3rem, 6vh, 5rem); }
.section-title.center { text-align: center; }
.section-title h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    font-weight: 800;
    margin-bottom: 1rem;
}

.services-section {
    padding: clamp(6rem, 12vh, 8rem) 0 100px;
    background: linear-gradient(180deg, transparent 0%, #0a0a0a 100px, #0a0a0a 100%);
    position: relative;
    z-index: 6;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: rgba(21, 21, 21, 0.7);
    backdrop-filter: blur(8px);
    padding: 3rem;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.service-card.featured {
    background: linear-gradient(145deg, rgba(26,26,26,0.9) 0%, rgba(21,21,21,0.9) 100%);
    border-color: rgba(197, 160, 111, 0.25);
}

.service-icon {
    font-size: 2.5rem;
    color: var(--copper);
    margin-bottom: 2rem;
    transition: transform 0.4s var(--ease-out-expo);
}

.service-card:hover .service-icon { transform: scale(1.15) rotate(-5deg); }

.service-card h3 { font-size: 1.5rem; margin-bottom: 1.5rem; }

.service-list { list-style: none; margin-top: 2rem; }

.service-list li {
    font-size: 0.9rem;
    color: var(--text-gray);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.service-list li i { color: var(--copper); font-size: 0.8rem; }

/* ── Projects ── */
.projects-section {
    padding: 120px 0;
    background: #0D0D0D;
}

.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 3rem;
}

.project-card {
    background: var(--bg-card);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.04);
    position: relative;
}

.project-content { padding: 3rem; }

.project-tag {
    display: inline-block;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--copper);
    margin-bottom: 1rem;
    font-weight: 600;
}

.project-card h3 { font-size: 1.8rem; margin-bottom: 0.5rem; }

.project-card .location {
    font-size: 0.85rem;
    color: var(--text-gray);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.project-card p:not(.location) {
    color: var(--text-gray);
    font-size: 1rem;
    line-height: 1.6;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--copper);
    font-weight: 600;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.35s, transform 0.35s;
}

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

/* ── Authority ── */
.authority-section { padding: 120px 0; }

.authority-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

.authority-content h2 {
    font-size: clamp(1.8rem, 4vw, 2.5rem);
    margin-bottom: 1.5rem;
}

.badges-container {
    display: flex;
    gap: 1.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.authority-btn {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--text-white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.authority-btn:hover {
    background: var(--accent-glow);
    border-color: var(--copper);
    color: var(--copper);
    transform: translateY(-2px);
}

.authority-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.stat-item {
    background: rgba(21,21,21,0.8);
    backdrop-filter: blur(8px);
    padding: 3rem;
    border-radius: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
    position: relative;
    overflow: hidden;
}

.stat-item .number {
    display: inline-block;
    font-size: 3rem;
    font-weight: 800;
    color: var(--copper);
    margin-bottom: 0.5rem;
}

.number-suffix {
    font-size: 2rem;
    font-weight: 800;
    color: var(--copper);
}

.stat-item .label {
    display: block;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 2px;
    color: var(--text-gray);
}

/* ── CTA ── */
.cta-section { padding: 120px 0 150px; }

.cta-card {
    background: rgba(13, 13, 13, 0.9);
    backdrop-filter: blur(12px);
    padding: 6rem 4rem;
    border-radius: 24px;
    text-align: center;
    border: 1px solid rgba(197, 160, 111, 0.3);
    box-shadow: 0 0 80px rgba(197, 160, 111, 0.1);
    position: relative;
    overflow: hidden;
}

.cta-card h2, .cta-card p, .cta-card .btn { position: relative; z-index: 1; }

.cta-card h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 1.5rem;
    letter-spacing: -2px;
}

.cta-card p {
    font-size: 1.2rem;
    margin-bottom: 3rem;
    color: var(--text-gray);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.cta-card .btn-primary {
    background: var(--copper);
    color: #000;
    border: none;
    padding: 1.2rem 3rem;
}

/* ── Footer ── */
.footer {
    padding: 3rem 0;
    border-top: 1px solid rgba(255,255,255,0.05);
    text-align: center;
}

.footer-content p {
    font-size: 0.8rem;
    color: var(--text-gray);
    margin-bottom: 0.5rem;
}

/* ── Reveal ── */
.reveal-up {
    opacity: 0;
    transform: translateY(60px);
}

/* ── Responsive ── */
@media (max-width: 968px) {
    .hero-grid, .authority-grid { grid-template-columns: 1fr; gap: 3rem; }
    .nav-links { display: none; }
    .menu-toggle { display: flex; }
    .hero-section { padding-top: 7rem; min-height: auto; }
    .hero-body { padding-bottom: 1.5rem; }
    .scroll-hint { display: none; }
    body, a, button { cursor: auto; }
    #cursor-dot, #cursor-ring { display: none; }
}

@media (max-width: 768px) {
    .badges-container { flex-direction: column; }
    .authority-btn { width: 100%; justify-content: center; }
    .authority-stats { grid-template-columns: 1fr; }
    .stat-item { padding: 1.5rem; }
    .hero-section { padding-top: 100px; }
}

@media (max-width: 576px) {
    .cta-card { padding: 3rem 1.5rem; }
    .container { padding: 0 1.25rem; }
    .code-card { padding: 1.25rem; }
    code { font-size: 0.72rem; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    body, a, button { cursor: auto; }
    #cursor-dot, #cursor-ring { display: none; }
}
