/* ============================================================
   Home page — hero, about, skills, featured projects, contact
   ============================================================ */

/* ---------- hero ---------- */

.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-height) + 48px) 0 48px;
    position: relative;
    overflow: hidden;
    /* subtle dot grid + radial glow */
    background-image:
        radial-gradient(ellipse 60% 50% at 70% 35%, rgba(34, 211, 238, 0.08), transparent 70%),
        radial-gradient(ellipse 50% 40% at 20% 80%, rgba(129, 140, 248, 0.06), transparent 70%),
        radial-gradient(rgba(148, 163, 184, 0.12) 1px, transparent 1px);
    background-size: 100% 100%, 100% 100%, 28px 28px;
}

.hero-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

.hero-greeting {
    font-family: var(--font-mono);
    color: var(--accent);
    margin-bottom: 12px;
}

.hero h1 {
    font-size: clamp(2.4rem, 6vw, 4rem);
    font-weight: 800;
    line-height: 1.1;
    color: #fff;
    letter-spacing: -0.02em;
}

.hero h2 {
    font-size: clamp(1.4rem, 3.5vw, 2.2rem);
    font-weight: 700;
    color: var(--muted);
    letter-spacing: -0.01em;
    margin-top: 4px;
}

.hero-typing {
    font-family: var(--font-mono);
    font-size: clamp(1rem, 2vw, 1.2rem);
    color: var(--accent);
    margin: 18px 0 14px;
    min-height: 1.8em;
}

.hero-typing .cursor {
    animation: blink 1s steps(1) infinite;
    margin-left: 2px;
}

@keyframes blink {
    50% { opacity: 0; }
}

.hero-tagline {
    max-width: 520px;
    color: var(--muted);
    margin-bottom: 28px;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 32px;
}

/* photo with glow ring */
.hero-photo {
    flex-shrink: 0;
}

.photo-ring {
    width: clamp(220px, 26vw, 300px);
    height: clamp(220px, 26vw, 300px);
    border-radius: 50%;
    padding: 6px;
    background: conic-gradient(from 180deg, var(--accent), var(--accent-2), var(--accent));
    box-shadow: 0 0 45px rgba(34, 211, 238, 0.25);
    animation: ringSpin 8s linear infinite;
}

.photo-ring img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 6px solid var(--bg);
    animation: ringSpinReverse 8s linear infinite;
}

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

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

/* ---------- about ---------- */

.about-grid {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 40px;
    align-items: start;
}

.about-text p {
    color: var(--muted);
    margin-bottom: 18px;
}

.about-text strong {
    color: var(--text);
}

.mono-label {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
}

.about-facts {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.fact-card {
    padding: 20px 22px;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    column-gap: 16px;
    align-items: center;
}

.fact-icon {
    grid-row: 1 / span 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 1.2rem;
}

.fact-card h3 {
    font-size: 1rem;
    color: #fff;
}

.fact-card p {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.5;
}

/* ---------- robot playground (signature interactive scene) ---------- */

.robot-scene {
    position: relative;
    height: 210px;
    margin-top: 56px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.03), transparent);
    overflow: hidden;
    outline: none;
    cursor: pointer;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.robot-scene:hover {
    border-color: rgba(34, 211, 238, 0.35);
}

.robot-scene:focus,
.robot-scene:focus-within {
    border-color: rgba(34, 211, 238, 0.55);
    box-shadow: 0 0 20px rgba(34, 211, 238, 0.12);
    cursor: default;
}

.scene-floor {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(34, 211, 238, 0.45), transparent);
}

/* HUD */
.scene-hud {
    position: absolute;
    top: 10px;
    left: 14px;
    right: 14px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    pointer-events: none;
    z-index: 6;
}

.hud-hint {
    color: var(--accent);
    opacity: 0.85;
}

.hud-score {
    color: var(--muted);
    opacity: 0.85;
    white-space: nowrap;
}

/* on-screen controls (always on touch, on hover/focus for pointer devices) */
.scene-controls {
    position: absolute;
    bottom: 34px;
    right: 14px;
    display: flex;
    gap: 8px;
    z-index: 7;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.robot-scene:hover .scene-controls,
.robot-scene:focus .scene-controls,
.robot-scene:focus-within .scene-controls {
    opacity: 1;
}

@media (hover: none) {
    .scene-controls {
        opacity: 1;
    }
}

.scene-controls button {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    background: rgba(10, 15, 30, 0.7);
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: 8px;
    cursor: pointer;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}

.scene-controls button:hover {
    background: var(--accent-soft);
    box-shadow: var(--glow);
}

/* rover — position driven by js/robot-scene.js */
.rover {
    position: absolute;
    bottom: 25px;
    left: 0;
    width: 96px;
    height: 74px;
    z-index: 4;
    will-change: transform;
}

.robot-body {
    position: absolute;
    bottom: 10px;
    left: 8px;
    width: 80px;
    height: 30px;
    background: var(--surface-2);
    border: 1px solid rgba(34, 211, 238, 0.5);
    border-radius: 8px;
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.18);
}

.robot-eye {
    position: absolute;
    top: 9px;
    right: 10px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 8px var(--accent);
    animation: eyeBlink 3.5s steps(1) infinite;
}

@keyframes eyeBlink {
    0%, 92%, 100% { opacity: 1; }
    94%, 98% { opacity: 0.15; }
}

.tire {
    position: absolute;
    bottom: -11px;
    width: 20px;
    height: 20px;
    background: #0d1526;
    border: 2px solid #2c3a55;
    border-radius: 50%;
    animation: rollTire 1.2s linear infinite;
    animation-play-state: paused;
}

.rover.moving .tire {
    animation-play-state: running;
}

.tire::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 50%;
    width: 2px;
    height: 5px;
    margin-left: -1px;
    background: var(--accent);
    border-radius: 1px;
}

.tire-left { left: 8px; }
.tire-right { right: 8px; }

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

.robot-arm {
    position: absolute;
    bottom: 40px;
    left: 20px;
}

.arm-segment {
    width: 26px;
    height: 6px;
    background: var(--accent-2);
    border-radius: 3px;
    transform-origin: left center;
    animation: swingArm 2.4s ease-in-out infinite alternate;
}

.arm-joint {
    position: absolute;
    left: -3px;
    top: -1px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 6px var(--accent);
}

@keyframes swingArm {
    from { transform: rotate(-30deg); }
    to { transform: rotate(-70deg); }
}

/* package — position driven by js/robot-scene.js */
.package {
    position: absolute;
    bottom: 28px;
    left: 0;
    width: 18px;
    height: 15px;
    background: var(--accent);
    border-radius: 3px;
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
    z-index: 3;
    transition: opacity 0.4s ease;
    will-change: transform;
}

.package::after {
    content: "";
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: rgba(10, 15, 30, 0.5);
}

/* drop box */
.drop-box {
    position: absolute;
    right: 20px;
    bottom: 25px;
    width: 46px;
    height: 32px;
    border: 2px dashed rgba(34, 211, 238, 0.5);
    border-top: none;
    border-radius: 0 0 6px 6px;
    z-index: 2;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.drop-box.flash {
    border-color: var(--accent);
    box-shadow: 0 0 22px rgba(34, 211, 238, 0.65);
    animation: boxPop 0.5s ease;
}

@keyframes boxPop {
    30% { transform: scale(1.12); }
}

/* humanoid — patrols the mid-ground */
.humanoid {
    --patrol: 240px;
    position: absolute;
    bottom: 25px;
    left: 10%;
    width: 26px;
    height: 64px;
    opacity: 0.75;
    z-index: 1;
    animation: patrol 22s linear infinite;
}

.h-head {
    position: absolute;
    top: 0;
    left: 50%;
    width: 14px;
    height: 14px;
    margin-left: -7px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid rgba(129, 140, 248, 0.6);
    box-shadow: 0 0 8px rgba(129, 140, 248, 0.25);
}

.h-head::after {
    content: "";
    position: absolute;
    top: 4px;
    right: 2px;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: var(--accent-2);
    box-shadow: 0 0 4px var(--accent-2);
}

.h-torso {
    position: absolute;
    top: 16px;
    left: 50%;
    width: 16px;
    height: 24px;
    margin-left: -8px;
    border-radius: 5px;
    background: var(--surface-2);
    border: 1px solid rgba(129, 140, 248, 0.6);
}

.h-arm {
    position: absolute;
    top: 18px;
    width: 4px;
    height: 20px;
    border-radius: 2px;
    background: var(--accent-2);
    transform-origin: top center;
}

.h-arm-l {
    left: 2px;
    animation: limbSwing 0.9s ease-in-out infinite alternate;
}

.h-arm-r {
    right: 2px;
    animation: limbSwing 0.9s ease-in-out infinite alternate-reverse;
}

.h-leg {
    position: absolute;
    top: 40px;
    width: 5px;
    height: 24px;
    border-radius: 2px;
    background: var(--surface-2);
    border: 1px solid rgba(129, 140, 248, 0.5);
    transform-origin: top center;
}

.h-leg-l {
    left: 6px;
    animation: limbSwing 0.9s ease-in-out infinite alternate-reverse;
}

.h-leg-r {
    right: 6px;
    animation: limbSwing 0.9s ease-in-out infinite alternate;
}

@keyframes limbSwing {
    from { transform: rotate(20deg); }
    to { transform: rotate(-20deg); }
}

@keyframes patrol {
    0%   { transform: translateX(0) scaleX(1); }
    46%  { transform: translateX(var(--patrol)) scaleX(1); }
    50%  { transform: translateX(var(--patrol)) scaleX(-1); }
    96%  { transform: translateX(0) scaleX(-1); }
    100% { transform: translateX(0) scaleX(1); }
}

/* drones — cruise across the sky */
.drone {
    position: absolute;
    left: 0;
    width: 46px;
    height: 16px;
    z-index: 1;
}

.drone-a {
    top: 20px;
    animation: flyRight 26s linear infinite;
}

.drone-b {
    top: 48px;
    transform-origin: center;
    animation: flyLeft 34s linear infinite;
    animation-delay: -14s;
    opacity: 0.8;
}

.drone-body {
    position: absolute;
    top: 4px;
    left: 50%;
    width: 22px;
    height: 8px;
    margin-left: -11px;
    background: var(--surface-2);
    border: 1px solid rgba(34, 211, 238, 0.5);
    border-radius: 4px;
}

.prop {
    position: absolute;
    top: 0;
    width: 16px;
    height: 2px;
    border-radius: 2px;
    background: rgba(34, 211, 238, 0.8);
    animation: propSpin 0.18s linear infinite;
}

.prop-l { left: 1px; }
.prop-r { right: 1px; }

@keyframes propSpin {
    0%, 100% { transform: scaleX(1); opacity: 0.9; }
    50%      { transform: scaleX(0.25); opacity: 0.4; }
}

.drone-led {
    position: absolute;
    bottom: 1px;
    left: 50%;
    width: 4px;
    height: 4px;
    margin-left: -2px;
    border-radius: 50%;
    animation: ledBlink 1.4s steps(1) infinite;
}

@keyframes ledBlink {
    0%, 55%   { background: #f87171; box-shadow: 0 0 6px #f87171; }
    56%, 100% { background: rgba(248, 113, 113, 0.25); box-shadow: none; }
}

@keyframes flyRight {
    0%   { transform: translate(-70px, 0); }
    30%  { transform: translate(calc(min(1100px, 92vw) * 0.3), -10px); }
    65%  { transform: translate(calc(min(1100px, 92vw) * 0.65), 6px); }
    100% { transform: translate(calc(min(1100px, 92vw) + 70px), -4px); }
}

@keyframes flyLeft {
    0%   { transform: translate(calc(min(1100px, 92vw) + 70px), -4px); }
    35%  { transform: translate(calc(min(1100px, 92vw) * 0.6), 8px); }
    70%  { transform: translate(calc(min(1100px, 92vw) * 0.25), -8px); }
    100% { transform: translate(-70px, 0); }
}

/* ---------- skills ---------- */

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

.skill-card h3 {
    font-size: 1.05rem;
    color: #fff;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.skill-card h3 i {
    color: var(--accent);
}

/* ---------- featured projects ---------- */

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 20px;
}

.project-card {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.project-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.project-icon {
    font-size: 1.6rem;
    color: var(--accent);
}

.star-badge {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 3px 10px;
    border-radius: 999px;
}

.project-card h3 {
    font-size: 1.1rem;
    color: #fff;
    line-height: 1.4;
}

.project-card > p {
    color: var(--muted);
    font-size: 0.92rem;
    flex: 1;
}

.project-links {
    display: flex;
    gap: 18px;
    padding-top: 4px;
}

.project-links a {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--muted);
    transition: color 0.25s ease;
}

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

.see-all {
    text-align: center;
    margin-top: 40px;
}

/* ---------- contact ---------- */

.contact-inner {
    text-align: center;
    max-width: 640px;
}

.contact-inner .section-title {
    justify-content: center;
}

.contact-inner .section-title::after {
    display: none;
}

.contact-text {
    color: var(--muted);
    margin-bottom: 28px;
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
    .photo-ring,
    .photo-ring img,
    .tire,
    .arm-segment,
    .robot-eye,
    .humanoid,
    .h-arm,
    .h-leg,
    .drone,
    .prop,
    .drone-led {
        animation: none;
    }
}

/* ---------- responsive ---------- */

@media (max-width: 900px) {
    .hero-inner {
        flex-direction: column-reverse;
        text-align: center;
        gap: 32px;
    }

    .hero-text {
        width: 100%;
        min-width: 0;
    }

    .hero-tagline {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-actions,
    .hero .social-icons {
        justify-content: center;
    }

    .about-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .robot-scene {
        height: 190px;
    }

    .humanoid {
        --patrol: 110px;
    }

    .hud-score {
        display: none;
    }
}
