/* ==========================================================
   MODERN LAYER — dimuat setelah style.css
   Berisi: latar bergerak, header kaca, animasi masuk,
   marquee, efek hover, kursor cahaya, dan progress scroll.
   ========================================================== */

:root {
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --glow: rgba(49, 85, 231, 0.18);
    --accent-2: #8a5cff;
}

:root[data-theme="dark"] {
    --glow: rgba(145, 164, 255, 0.16);
    --accent-2: #b79bff;
}

body {
    position: relative;
    overflow-x: hidden;
}

/* ---------- Latar belakang aurora ---------- */
.aurora {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.aurora span {
    position: absolute;
    width: 46vmax;
    height: 46vmax;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.5;
    animation: drift 24s ease-in-out infinite alternate;
}

.aurora span:nth-child(1) { top: -18vmax; right: -12vmax; background: var(--glow); }
.aurora span:nth-child(2) { bottom: -22vmax; left: -14vmax; background: rgba(138, 92, 255, 0.14); animation-duration: 30s; }
.aurora span:nth-child(3) { top: 40%; left: 38%; width: 30vmax; height: 30vmax; background: rgba(49, 85, 231, 0.08); animation-duration: 36s; }

@keyframes drift {
    from { transform: translate3d(0, 0, 0) scale(1); }
    to   { transform: translate3d(-6vmax, 5vmax, 0) scale(1.15); }
}

/* ---------- Progress scroll ---------- */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 60;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    transform: scaleX(0);
    transform-origin: left;
}

/* ---------- Header kaca ---------- */
.site-header {
    background: var(--header);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    transition: transform 0.45s var(--ease), box-shadow 0.3s, height 0.3s;
}

.site-header.is-scrolled {
    height: 68px;
    box-shadow: 0 10px 30px var(--shadow);
}

.main-nav a {
    position: relative;
    padding: 6px 0;
}

.main-nav a::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 2px;
    background: var(--accent);
    transform: scaleX(0);
    transform-origin: right;
    transition: transform 0.4s var(--ease);
}

.main-nav a:hover,
.main-nav a.is-active { color: var(--ink); }

.main-nav a:hover::after,
.main-nav a.is-active::after {
    transform: scaleX(1);
    transform-origin: left;
}


/* ---------- Animasi masuk hero ---------- */
.hero .eyebrow,
.hero-kicker,
.hero-description,
.hero-actions,
.hero-portrait {
    opacity: 0;
    animation: rise 1s var(--ease) forwards;
}

.hero .eyebrow { animation-delay: 0.1s; }
.hero-kicker { animation-delay: 0.25s; }
.hero-description { animation-delay: 0.85s; }
.hero-actions { animation-delay: 1s; }
.hero-portrait { animation-delay: 0.5s; animation-name: rise-scale; }

@keyframes rise {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: none; }
}

@keyframes rise-scale {
    from { opacity: 0; transform: translateY(40px) scale(0.94) rotate(2deg); }
    to   { opacity: 1; transform: none; }
}

/* Judul: per huruf, dibuat oleh JS */
.hero h1 .char {
    display: inline-block;
    opacity: 0;
    transform: translateY(70%) rotate(6deg);
    animation: char-in 0.9s var(--ease) forwards;
    animation-delay: calc(0.35s + var(--i) * 0.035s);
}

@keyframes char-in {
    to { opacity: 1; transform: none; }
}

.hero h1 span {
    background: linear-gradient(100deg, var(--accent), var(--accent-2), var(--accent));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 6s linear infinite;
}

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

/* Foto: melayang + tilt (diatur JS lewat --rx / --ry) */
.hero .hero-grid .hero-portrait img {
    border-radius: 6px;
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
    transition: transform 0.25s ease-out, box-shadow 0.4s var(--ease);
    animation: float 7s ease-in-out infinite;
}

.hero .hero-grid .hero-portrait:hover img {
    box-shadow: 16px 16px 0 var(--accent);
}

@keyframes float {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -10px; }
}

/* ---------- Tombol ---------- */
.button {
    position: relative;
    overflow: hidden;
    border-radius: 999px;
    padding: 15px 24px;
    isolation: isolate;
    transition: transform 0.3s var(--ease), box-shadow 0.3s;
}

.button::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    transform: translateY(101%);
    transition: transform 0.5s var(--ease);
}

.button:hover::before { transform: translateY(0); }
.button-dark:hover { background: var(--ink); box-shadow: 0 12px 28px var(--glow); }
.button span { transition: transform 0.3s var(--ease); }
.button:hover span { transform: translate(3px, 3px); }

.text-link span,
.contact-email span,
.project-open { transition: transform 0.3s var(--ease); }
.text-link:hover span,
.contact-email:hover span { transform: translate(4px, -4px); }

/* ---------- Marquee (dibuat JS dari .hero-meta) ---------- */
.hero-meta {
    display: block;
    overflow: hidden;
    padding: 18px 0;
    mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.marquee-track {
    display: flex;
    width: max-content;
    gap: 48px;
    animation: marquee 28s linear infinite;
}

.hero-meta:hover .marquee-track { animation-play-state: paused; }

.marquee-track span { display: inline-flex; align-items: center; gap: 48px; white-space: nowrap; }
.marquee-track span::after { content: "✦"; color: var(--accent); }

@keyframes marquee {
    to { transform: translateX(-50%); }
}

/* ---------- Reveal saat scroll ---------- */
.will-reveal {
    opacity: 0;
    transform: translateY(36px);
    transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
    transition-delay: var(--d, 0s);
}

.will-reveal.is-visible {
    opacity: 1;
    transform: none;
}

.section-heading h2 em,
.contact-grid h2 em {
    background: linear-gradient(100deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Kartu karya ---------- */
.project-card {
    border-radius: 14px;
    transition: transform 0.6s var(--ease), box-shadow 0.4s;
}

.project-card .project-visual {
    border-radius: 14px;
    overflow: hidden;
}

.project-card .project-card-image,
.project-card .project-card-video {
    transition: transform 1s var(--ease);
}

.project-card:hover .project-card-image,
.project-card:hover .project-card-video { transform: scale(1.06); }

.project-card:hover .visual-arrow { transform: translate(4px, -4px) rotate(8deg); }
.project-card .project-info h3 a { background: linear-gradient(var(--accent), var(--accent)) 0 100% / 0 2px no-repeat; transition: background-size 0.5s var(--ease); }
.project-card:hover .project-info h3 a { background-size: 100% 2px; }
.project-open:hover { transform: rotate(45deg); }

/* ---------- Kartu & daftar lain ---------- */
.about-stats > div,
.education-card,
.timeline-item,
.skill-group {
    transition: transform 0.5s var(--ease), box-shadow 0.4s, border-color 0.3s, background 0.3s;
}

.about-stats > div:hover,
.education-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 22px 44px var(--shadow);
    border-color: var(--accent);
}

.timeline-item:hover { transform: translateX(10px); }
.timeline-item:hover .timeline-mark { color: var(--accent); transform: translate(3px, -3px); }
.timeline-mark { transition: transform 0.3s var(--ease), color 0.3s; }

.skill-tags span,
.tool-list span,
.education-tags span {
    transition: transform 0.3s var(--ease), background 0.3s, color 0.3s, border-color 0.3s;
}

.skill-tags span:hover,
.tool-list span:hover,
.education-tags span:hover {
    transform: translateY(-3px) scale(1.04);
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.stat-index { display: inline-block; transition: transform 0.5s var(--ease); }
.about-stats > div:hover .stat-index { transform: rotate(-12deg) scale(1.3); color: var(--accent); }

/* ---------- Kontak & footer ---------- */
.contact-section {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
}

.contact-section::before {
    content: "";
    position: absolute;
    top: -30%;
    right: -10%;
    z-index: 0;
    width: 50%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, var(--glow), transparent 65%);
    animation: drift 14s ease-in-out infinite alternate;
    pointer-events: none;
}

.contact-section > * { position: relative; z-index: 1; }

.contact-links a {
    display: inline-block;
    transition: transform 0.3s var(--ease), color 0.3s;
}

.contact-links a:hover { color: var(--accent); transform: translateY(-3px); }

.footer-brand { transition: letter-spacing 0.5s var(--ease); }
.footer-brand:hover { letter-spacing: 0.12em; }

/* ---------- Layar kecil & sentuh ---------- */
@media (hover: none), (max-width: 900px) {
    .timeline-item:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .aurora span, .marquee-track, .hero h1 span,
    .hero .hero-grid .hero-portrait img { animation: none !important; }

    .hero .eyebrow, .hero-kicker, .hero-description, .hero-actions,
    .hero-portrait, .hero h1 .char { opacity: 1 !important; transform: none !important; }
}
