:root {
    --primary-color: #3b82f6;
    --dark-bg: #111111;
    --light-bg: #ffffff;
    --text-dark: #111111;
    --text-light: #f0f0f0;
    --text-muted: #6b7280;
    --font-family: 'Inter', 'Noto Sans JP', sans-serif;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* === LOADER === */
#loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--light-bg);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.8s ease;
}

.loader-content {
    text-align: center;
}

.logo-text {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.loading-text {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.progress-bar {
    width: 200px;
    height: 4px;
    background-color: #e0e0e0;
    border-radius: 2px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

.progress-bar::after {
    content: '';
    position: absolute;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    animation: loading 2s ease-in-out forwards;
    border-radius: 2px;
}

@keyframes loading {
    to { left: 0; }
}

/* === HERO ANIMATIONS === */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.hero-content {
    text-align: center;
    z-index: 10;
    position: relative;
}

.hero-title {
    font-size: 4.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 1.5rem;
    margin-bottom: 2rem;
    color: var(--text-muted);
}

.typewriter-text {
    position: relative;
}

.typewriter-text::after {
    content: '|';
    animation: blink 1s infinite;
    color: var(--primary-color);
}

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

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

.tag-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

.tag-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.hero-cta {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
}

.btn-secondary {
    background: transparent;
    color: var(--text-dark);
    border: 2px solid var(--primary-color);
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

/* === FLOATING ELEMENTS === */
.hero-visual {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.floating-elements {
    position: relative;
    width: 100%;
    height: 100%;
}

.floating-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.9);
    padding: 1.5rem 2rem;
    border-radius: 15px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.1);
    backdrop-filter: blur(10px);
    font-weight: 600;
    color: var(--text-dark);
    animation: float 6s ease-in-out infinite;
}

.card-1 {
    top: 15%;
    left: 10%;
    animation-delay: 0s;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
}

.card-2 {
    top: 25%;
    right: 15%;
    animation-delay: 1s;
}

.card-3 {
    bottom: 30%;
    left: 20%;
    animation-delay: 2s;
    background: linear-gradient(135deg, #f093fb, #f5576c);
    color: white;
}

.card-4 {
    bottom: 40%;
    right: 10%;
    animation-delay: 3s;
}

.card-5 {
    top: 60%;
    left: 50%;
    animation-delay: 4s;
    background: linear-gradient(135deg, #4facfe, #00f2fe);
    color: white;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    33% {
        transform: translateY(-20px) rotate(2deg);
    }
    66% {
        transform: translateY(10px) rotate(-1deg);
    }
}

/* === SCROLL INDICATOR === */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    color: var(--text-muted);
    z-index: 10;
}

.scroll-line {
    width: 2px;
    height: 50px;
    background: var(--primary-color);
    margin: 0 auto 1rem;
    animation: scrollPulse 2s ease-in-out infinite;
}

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

/* === ANIMATION CLASSES === */
.animate-up {
    opacity: 0;
    transform: translateY(50px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.animate-up.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Fade In Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Slide Up Animation */
@keyframes slideUp {
    from { 
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Slide Left Animation */
@keyframes slideLeft {
    from { 
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Slide Right Animation */
@keyframes slideRight {
    from { 
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Zoom In Animation */
@keyframes zoomIn {
    from { 
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Pulse Animation */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

/* Bounce Animation */
@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Rotation Animation */
@keyframes rotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Page Enter Animation */
@keyframes pageEnter {
    from { 
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Exit Animation */
@keyframes pageExit {
    from { 
        opacity: 1;
        transform: translateY(0);
    }
    to {
        opacity: 0;
        transform: translateY(-15px);
    }
}

/* ---------- Animation Base Classes ---------- */

/* Animation settings for all animated elements */
[data-animate] {
    will-change: opacity, transform;
    backface-visibility: hidden;
}

/* Animation hidden state */
.animate-hidden {
    opacity: 0;
}

/* Animation visible state */
.animate-visible {
    opacity: 1;
}

/* Animation Types */
.animate-fade-in.animate-visible {
    animation: fadeIn 0.8s ease forwards;
}

.animate-slide-up.animate-visible {
    animation: slideUp 0.8s ease forwards;
}

.animate-slide-left.animate-visible {
    animation: slideLeft 0.8s ease forwards;
}

.animate-slide-right.animate-visible {
    animation: slideRight 0.8s ease forwards;
}

.animate-zoom-in.animate-visible {
    animation: zoomIn 0.8s ease forwards;
}

/* ---------- Hover Effects ---------- */

/* Card hover animation */
.card-hover {
    transform: translateY(-8px) !important;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15) !important;
    transition: all 0.3s ease !important;
}

/* Button hover effect */
.btn-hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

/* Image hover zoom effect */
.image-hover {
    overflow: hidden;
}

.image-hover img {
    transition: transform 0.5s ease;
}

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

/* Icon hover effect */
.icon-hover {
    transition: transform 0.3s ease, color 0.3s ease;
}

.icon-hover:hover {
    transform: translateY(-3px);
    color: var(--primary-color);
}

/* ---------- Page Transitions ---------- */

/* Default body transition settings */
body {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Page enter animation */
.page-enter {
    animation: pageEnter 0.5s ease forwards;
}

/* Page exit animation */
.page-exit {
    animation: pageExit 0.3s ease forwards;
}

/* ---------- Parallax Effect ---------- */

/* Parallax background */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    will-change: background-position;
}

/* ---------- Interactive Elements ---------- */

/* Pulsing CTA button */
.pulse-cta {
    animation: pulse 2s infinite;
}

/* Bounce animation for attention */
.bounce {
    animation: bounce 2s infinite;
}

/* Rotating loader */
.rotate {
    animation: rotate 1.5s linear infinite;
}

/* ---------- Card Grid Cascade Animation ---------- */

/* For card grid layouts, cascade the animations */
.card-grid [data-animate] {
    transition-duration: 0.8s;
}

/* Each card appears with a short delay after the previous one */
.card-grid [data-animate]:nth-child(1) { transition-delay: 0.1s; }
.card-grid [data-animate]:nth-child(2) { transition-delay: 0.2s; }
.card-grid [data-animate]:nth-child(3) { transition-delay: 0.3s; }
.card-grid [data-animate]:nth-child(4) { transition-delay: 0.4s; }
.card-grid [data-animate]:nth-child(5) { transition-delay: 0.5s; }
.card-grid [data-animate]:nth-child(6) { transition-delay: 0.6s; }
.card-grid [data-animate]:nth-child(7) { transition-delay: 0.7s; }
.card-grid [data-animate]:nth-child(8) { transition-delay: 0.8s; }
.card-grid [data-animate]:nth-child(9) { transition-delay: 0.9s; }
.card-grid [data-animate]:nth-child(10) { transition-delay: 1s; }

/* ---------- Special Elements Animation ---------- */

/* Header animation */
.header-animate {
    position: relative;
    overflow: hidden;
}

.header-animate::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--primary-color);
    transition: width 0.5s ease;
}

.header-animate:hover::after,
.header-animate.active::after {
    width: 100%;
}

/* Text reveal animation */
.text-reveal {
    overflow: hidden;
}

.text-reveal span {
    display: inline-block;
    transform: translateY(100%);
    transition: transform 0.5s ease;
}

.text-reveal.reveal span {
    transform: translateY(0);
}

/* ---------- Performance Optimizations ---------- */

/* Optimize animations for devices that prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* animations.css - Animation styles for portfolio website */

/* ===== Basic Transitions ===== */
.header-animate {
    transition: color 0.3s ease, transform 0.3s ease;
}

.header-animate:hover, .header-animate:focus {
    color: var(--accent-color);
    transform: translateY(-2px);
}

.icon-hover {
    transition: all 0.3s ease;
}

.icon-hover:hover, .icon-hover:focus {
    color: var(--accent-color);
    transform: translateY(-3px);
}

/* ===== Loading Animations ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes slideDown {
    from { 
        opacity: 0;
        transform: translateY(-30px);
    }
    to { 
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideLeft {
    from { 
        opacity: 0;
        transform: translateX(30px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from { 
        opacity: 0;
        transform: translateX(-30px);
    }
    to { 
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from { 
        opacity: 0;
        transform: scale(0.9);
    }
    to { 
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-10px);}
    60% {transform: translateY(-5px);}
}

/* ===== Button Animations ===== */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--accent-color-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--accent-color-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--accent-color-rgb), 0);
    }
}

.pulse-cta {
    animation: pulse 2s infinite;
}

.bounce {
    animation: bounce 2s infinite;
}

/* ===== Scroll Animation Classes ===== */
.animated {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.animated.fade-in {
    animation: fadeIn 0.8s forwards;
}

.animated.slide-up {
    animation: slideUp 0.8s forwards;
}

.animated.slide-down {
    animation: slideDown 0.8s forwards;
}

.animated.slide-left {
    animation: slideLeft 0.8s forwards;
}

.animated.slide-right {
    animation: slideRight 0.8s forwards;
}

.animated.zoom-in {
    animation: zoomIn 0.8s forwards;
}

/* ===== Parallax Effects ===== */
.parallax {
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    position: relative;
    overflow: hidden;
}

/* ===== Card Hover Effects ===== */
.card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover, .card:focus-within {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

/* ===== Image Hover Effects ===== */
.img-hover-zoom {
    overflow: hidden;
}

.img-hover-zoom img {
    transition: transform 0.5s ease;
}

.img-hover-zoom:hover img {
    transform: scale(1.05);
}

/* ===== Stagger Animation Delay ===== */
.stagger-item:nth-child(1) { animation-delay: 0.1s; }
.stagger-item:nth-child(2) { animation-delay: 0.2s; }
.stagger-item:nth-child(3) { animation-delay: 0.3s; }
.stagger-item:nth-child(4) { animation-delay: 0.4s; }
.stagger-item:nth-child(5) { animation-delay: 0.5s; }
.stagger-item:nth-child(6) { animation-delay: 0.6s; }
.stagger-item:nth-child(7) { animation-delay: 0.7s; }
.stagger-item:nth-child(8) { animation-delay: 0.8s; }

/* ===== Progress Bar Animation ===== */
@keyframes progressAnimation {
    from { width: 0; }
    to { width: 100%; }
}

.animated-progress .progress-bar {
    animation: progressAnimation 1.5s ease-out forwards;
}

/* ===== Typing Animation ===== */
@keyframes typing {
    from { width: 0 }
    to { width: 100% }
}

@keyframes blink-caret {
    from, to { border-color: transparent }
    50% { border-color: var(--accent-color) }
}

.typing-animation {
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--accent-color);
    animation: 
        typing 3.5s steps(40, end),
        blink-caret 0.75s step-end infinite;
}

/* ===== Media Queries ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    
    .parallax {
        background-attachment: scroll;
    }
} 