/* =========================================================
   Abhishek Raj — Architect Portfolio
   Custom styles layered on top of Tailwind (CDN)
   ========================================================= */

:root {
    --accent: #eab35a;
    --accent-strong: #f5b041;
    --bg: #09090b;
}

html { scroll-behavior: smooth; }
body {
    background-color: var(--bg);
    color: #e4e4e7;
    font-family: 'Inter', system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

h1, h2, h3, .font-display {
    font-family: 'Space Grotesk', 'Inter', sans-serif;
    letter-spacing: -0.02em;
}

::selection { background: var(--accent-strong); color: #111; }

/* Custom scrollbar */
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: #0d0d10; }
::-webkit-scrollbar-thumb { background: #2a2a30; border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: #3a3a42; }

/* ---- Backgrounds & decorations ---- */
.grid-bg {
    background-image:
        linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
    background-size: 56px 56px;
    -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
    mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

.glow {
    position: absolute;
    border-radius: 9999px;
    filter: blur(120px);
    opacity: 0.5;
    pointer-events: none;
}

.gradient-text {
    background: linear-gradient(120deg, #fef3d0 0%, var(--accent-strong) 55%, #c98a2e 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---- Cards ---- */
.card {
    background: linear-gradient(160deg, rgba(24,24,27,0.9), rgba(15,15,18,0.9));
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 18px;
    transition: transform .35s cubic-bezier(.2,.7,.3,1), border-color .35s, box-shadow .35s;
}
.card:hover {
    transform: translateY(-5px);
    border-color: rgba(234,179,90,0.4);
    box-shadow: 0 18px 50px -20px rgba(234,179,90,0.28);
}

/* ---- Nav ---- */
.nav-link { position: relative; }
.nav-link::after {
    content: '';
    position: absolute;
    left: 0; bottom: -4px;
    width: 0; height: 2px;
    background: var(--accent-strong);
    transition: width .3s ease;
}
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

/* ---- Timeline ---- */
.timeline-line { background: linear-gradient(180deg, var(--accent-strong), transparent); }

/* ---- Reveal on scroll ---- */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.3,1);
    will-change: opacity, transform;
}
.reveal.visible { opacity: 1; transform: none; }

/* Stagger children */
.reveal[data-delay="1"] { transition-delay: .08s; }
.reveal[data-delay="2"] { transition-delay: .16s; }
.reveal[data-delay="3"] { transition-delay: .24s; }
.reveal[data-delay="4"] { transition-delay: .32s; }

@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}

/* ---- Buttons ---- */
.btn-accent {
    background: var(--accent-strong);
    color: #16130c;
    font-weight: 600;
    transition: transform .2s ease, box-shadow .2s ease, filter .2s;
}
.btn-accent:hover { transform: translateY(-2px); box-shadow: 0 12px 30px -10px rgba(245,176,65,.55); filter: brightness(1.05); }

.btn-ghost {
    border: 1px solid rgba(255,255,255,0.15);
    transition: border-color .2s, background .2s;
}
.btn-ghost:hover { border-color: var(--accent-strong); background: rgba(245,176,65,0.06); }

/* Chip / tag */
.chip {
    background: rgba(245,176,65,0.09);
    border: 1px solid rgba(245,176,65,0.22);
    color: #f3cd8b;
}

/* Project card image fallback pattern */
.img-fallback {
    background:
        radial-gradient(circle at 30% 30%, rgba(245,176,65,0.14), transparent 60%),
        repeating-linear-gradient(45deg, rgba(255,255,255,0.03) 0 2px, transparent 2px 16px),
        #16161a;
}

/* Marquee for skills strip */
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-track { animation: marquee 32s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* Filter active state */
.filter-btn.active { background: var(--accent-strong); color:#16130c; border-color: var(--accent-strong); }

/* Float animation for hero badge */
@keyframes floaty { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.floaty { animation: floaty 5s ease-in-out infinite; }

/* =========================================================
   MOBILE RESPONSIVENESS
   Overrides & enhancements for small screens
   ========================================================= */

/* ---- Very small phones (< 400px) ---- */
@media (max-width: 400px) {
    #home h1 {
        font-size: 1.75rem !important; /* 28px */
        line-height: 1.1 !important;
    }
    #home h1 + p {
        font-size: 1.125rem !important; /* 18px */
    }
    #home .hero-subtext {
        font-size: 0.875rem !important;
    }
    .hero-badge {
        bottom: -0.75rem !important;
        left: -0.75rem !important;
        padding: 0.5rem 0.75rem !important;
    }
    .hero-badge span:first-child {
        width: 2rem !important;
        height: 2rem !important;
    }
    .hero-badge p:first-of-type {
        font-size: 0.75rem !important;
    }
    .hero-badge p:last-of-type {
        font-size: 0.625rem !important;
    }
    .hero-btn-group {
        flex-direction: column;
        width: 100%;
    }
    .hero-btn-group a,
    .hero-btn-group button {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    .hero-photo {
        width: 14rem !important;
        height: 14rem !important;
    }
    .stat-number {
        font-size: 1.5rem !important;
    }
    .py-24 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }
    .sm\:py-28 {
        padding-top: 4rem !important;
        padding-bottom: 4rem !important;
    }
    .px-5 {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
    .education-card {
        padding: 1rem !important;
    }
    .project-card .p-5 {
        padding: 1rem !important;
    }
    /* Timeline on very small screens */
    .timeline-item {
        padding-left: 2.5rem !important;
    }
    .timeline-item .card {
        padding: 1rem !important;
    }
    .timeline-item .chip {
        font-size: 0.625rem !important;
        padding: 0.125rem 0.5rem !important;
    }
}

/* ---- Small phones (< 640px) ---- */
@media (max-width: 639px) {
    /* Better button touch targets */
    .btn-accent, .btn-ghost {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
    /* Nav improvements */
    #navbar .max-w-6xl {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    #mobileMenu a {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
        font-size: 0.9375rem;
    }
    /* Hero section */
    #home {
        padding-top: 5rem;
    }
    #home .gap-12 {
        gap: 2.5rem;
    }
    .hero-photo-wrap {
        margin-top: 1rem;
    }
    /* Stats */
    .stat-number {
        font-size: 1.75rem;
    }
    /* Timeline mobile adjustments */
    .timeline-item {
        padding-left: 3rem;
    }
    .timeline-item .card {
        padding: 1.25rem;
    }
    .timeline-line-mobile {
        left: 0.875rem !important;
    }
    .timeline-dot {
        left: 0.875rem !important;
        width: 0.75rem !important;
        height: 0.75rem !important;
    }
    /* Section headings */
    section h2.font-display.text-3xl {
        font-size: 1.75rem;
    }
    /* Filter buttons wrap fix */
    .filter-btn {
        font-size: 0.75rem;
        padding: 0.375rem 0.875rem;
    }
    /* Contact form card */
    #contact .card {
        padding: 1.5rem !important;
    }
    /* Venture items */
    .venture-item {
        padding: 1.5rem !important;
    }
    .venture-item ul.grid {
        grid-template-columns: 1fr !important;
    }
    /* Footer */
    footer .flex-col {
        gap: 0.75rem;
    }
}

/* ---- Tablet (< 1024px) ---- */
@media (max-width: 1023px) {
    /* Timeline tablet adjustments */
    .timeline-line {
        left: 0.875rem !important;
    }
    .timeline-dot {
        left: 0.875rem !important;
    }
    .timeline-item-tablet {
        padding-left: 3rem !important;
    }
    /* Hero image on tablet */
    .hero-photo-wrap {
        margin-top: 2rem;
    }
}

/* ---- Fix for overflow on all screens ---- */
img, svg, video {
    max-width: 100%;
    height: auto;
}

/* Better touch targets globally */
@media (pointer: coarse) {
    .nav-item a,
    .filter-btn,
    button, 
    a.btn-accent, 
    a.btn-ghost {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
    .nav-item {
        min-height: 44px;
    }
}

/* Smooth sidebar transition for admin */
#sidebar {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Fix for admin mobile */
@media (max-width: 1023px) {
    #sidebar {
        width: 280px;
    }
    .admin-main {
        padding: 1rem !important;
    }
    .admin-header {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }
}

/* Fix admin stat cards on very small screens */
@media (max-width: 400px) {
    .admin-stat-card {
        padding: 0.75rem !important;
    }
    .admin-stat-card .font-display.text-3xl {
        font-size: 1.5rem !important;
    }
}

/* Prevent horizontal scroll - body already has overflow-x:hidden */

/* Admin form mobile improvements */
@media (max-width: 639px) {
    .admin-form-sidebar {
        position: static !important;
    }
    .admin-form-grid {
        grid-template-columns: 1fr !important;
    }
    .admin-table-actions {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .admin-message-meta {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.5rem;
    }
    /* Better spacing for stacked form elements */
    .admin-form-section {
        padding: 1.25rem !important;
    }
    /* Admin mobile sidebar */
    #sidebar {
        width: 260px;
    }
    #sidebar .nav-item {
        padding-top: 0.75rem;
        padding-bottom: 0.75rem;
    }
}

/* Admin login mobile */
@media (max-width: 400px) {
    .admin-login-box {
        padding: 1.5rem !important;
    }
}

/* Better mobile project card layouts */
@media (max-width: 639px) {
    .project-card-grid {
        grid-template-columns: 1fr !important;
    }
    .project-card-list-item {
        flex-direction: column !important;
    }
    .project-card-list-item .w-28 {
        width: 100% !important;
        height: 8rem !important;
    }
}

/* Admin skills page mobile */
@media (max-width: 639px) {
    .skills-form-sticky {
        position: static !important;
    }
    .skills-tag {
        font-size: 0.8125rem;
        padding: 0.375rem 0.625rem;
    }
}

/* Messages page mobile */
@media (max-width: 639px) {
    .message-card {
        padding: 1rem !important;
    }
    .message-card .flex.items-start {
        flex-direction: column;
        gap: 0.75rem;
    }
    .message-actions {
        flex-wrap: wrap;
        width: 100%;
    }
    .message-actions form {
        flex: 1;
    }
    .message-actions button,
    .message-actions a {
        width: 100%;
        justify-content: center;
    }
}

/* Admin profile page mobile */
@media (max-width: 639px) {
    .profile-photo-section {
        flex-direction: column !important;
        align-items: stretch !important;
    }
    .profile-photo-section .w-32 {
        margin: 0 auto;
    }
}
