/* ============================================================
   HOME PAGE
   ============================================================ */

/* ---------- Hero ---------- */
.masthead {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 92svh;
    display: flex;
    align-items: center;
    padding: calc(var(--nav-height) + 3rem) 0 4rem;
    background: var(--bg);
}

/* Aurora: three blurred blobs drifting behind a faint grid */
.aurora {
    position: absolute;
    inset: -20%;
    z-index: -2;
    filter: blur(70px);
    opacity: 0.55;
    pointer-events: none;
}
[data-bs-theme="dark"] .aurora { opacity: 0.6; }
.aurora span {
    position: absolute;
    border-radius: 50%;
    mix-blend-mode: screen;
}
[data-bs-theme="light"] .aurora span { mix-blend-mode: multiply; opacity: 0.45; }
.aurora span:nth-child(1) { width: 48vw; height: 48vw; top: 5%; left: 10%; background: rgba(var(--accent-rgb), 0.55); }
.aurora span:nth-child(2) { width: 40vw; height: 40vw; top: 25%; right: 5%; background: rgba(var(--accent-2-rgb), 0.5); }
.aurora span:nth-child(3) { width: 30vw; height: 30vw; bottom: 0; left: 40%; background: rgba(56, 189, 248, 0.4); }
@media (prefers-reduced-motion: no-preference) {
    .aurora span:nth-child(1) { animation: drift-a 22s ease-in-out infinite alternate; }
    .aurora span:nth-child(2) { animation: drift-b 26s ease-in-out infinite alternate; }
    .aurora span:nth-child(3) { animation: drift-c 30s ease-in-out infinite alternate; }
}
@keyframes drift-a { to { transform: translate(14vw, 8vh) scale(1.15); } }
@keyframes drift-b { to { transform: translate(-12vw, 12vh) scale(0.9); } }
@keyframes drift-c { to { transform: translate(8vw, -12vh) scale(1.2); } }

.masthead::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        linear-gradient(var(--grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
    background-size: 56px 56px;
    mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 20%, transparent 100%);
    -webkit-mask-image: radial-gradient(ellipse 80% 70% at 50% 50%, #000 20%, transparent 100%);
    pointer-events: none;
}

.masthead-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    color: var(--accent);
    margin-bottom: 1.25rem;
}
.masthead-eyebrow .cursor {
    display: inline-block;
    width: 0.55em;
    height: 1.05em;
    margin-left: 0.2em;
    vertical-align: -0.15em;
    background: currentColor;
}
@media (prefers-reduced-motion: no-preference) {
    .masthead-eyebrow .cursor { animation: blink 1.1s steps(2, start) infinite; }
}
@keyframes blink { to { visibility: hidden; } }

.masthead-heading {
    font-size: clamp(2.6rem, 7vw, 5rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    margin-bottom: 1.25rem;
    color: var(--heading);
}
.masthead-heading .gradient-text {
    background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 55%, var(--accent) 100%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
@media (prefers-reduced-motion: no-preference) {
    .masthead-heading .gradient-text { animation: shimmer 7s linear infinite; }
}
@keyframes shimmer { to { background-position: 200% 50%; } }

.masthead-subheading {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    line-height: 1.5;
    color: var(--text);
    max-width: 34rem;
    margin-bottom: 2rem;
}
.masthead-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.masthead-actions .btn { padding: 0.8rem 1.5rem; }

/* Avatar with an animated conic ring */
.masthead-avatar-wrap {
    position: relative;
    width: min(60vw, 300px);
    aspect-ratio: 1;
    margin-inline: auto;
    padding: 6px;
    border-radius: 50%;
    background: conic-gradient(from var(--angle), var(--accent), var(--accent-2), transparent 70%, var(--accent));
}
@media (prefers-reduced-motion: no-preference) {
    .masthead-avatar-wrap { animation: spin 9s linear infinite; }
}
@keyframes spin { to { --angle: 360deg; } }
.masthead-avatar-wrap::after {
    content: "";
    position: absolute;
    inset: -14%;
    z-index: -1;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--accent-rgb), 0.35), transparent 65%);
    filter: blur(20px);
}
.masthead-avatar {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--bg);
}

/* Status chips under the avatar */
.masthead-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}
.chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 70%, transparent);
    backdrop-filter: blur(8px);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.04em;
    color: var(--text);
}
.chip .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }

.scroll-cue {
    position: absolute;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    z-index: 1;
}
.scroll-cue:hover { color: var(--accent); }
@media (prefers-reduced-motion: no-preference) {
    .scroll-cue { animation: bob 2s ease-in-out infinite; }
}
@keyframes bob {
    0%, 100% { transform: translate(-50%, 0); }
    50% { transform: translate(-50%, 6px); }
}

@media (max-width: 991.98px) {
    .masthead { min-height: auto; text-align: center; }
    .masthead-subheading { margin-inline: auto; }
    .masthead-actions { justify-content: center; }
    .masthead-avatar-wrap { width: min(55vw, 220px); margin-bottom: 2rem; }
}

/* ---------- Philosophy: each paragraph becomes a principle card ---------- */
.principles { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.principles .about-text { display: contents; }
.principles .about-text p {
    position: relative;
    margin: 0;
    padding: 1.6rem 1.5rem 1.5rem;
    font-size: 1rem;
    line-height: 1.7;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    counter-increment: principle;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease, border-color 0.3s ease;
}
.principles .about-text p::before {
    content: "0" counter(principle);
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: 0.75rem;
}
.principles .about-text p b, .principles .about-text p strong {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
    color: var(--heading);
}
.principles .about-text p:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: rgba(var(--accent-rgb), 0.4); }
.principles { counter-reset: principle; }

/* ---------- Skills: animated conic border on hover ---------- */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
    gap: 0.9rem;
    margin: 0;
}
.skill-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    min-height: 8rem;
    padding: 1.25rem 0.5rem;
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--heading);
    text-align: center;
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
}
.skill-card::before {
    content: "";
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: conic-gradient(from var(--angle), transparent 0 60%, var(--accent) 80%, var(--accent-2) 90%, transparent 100%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.skill-card:hover { transform: translateY(-5px); box-shadow: var(--glow); }
.skill-card:hover::before { opacity: 1; }
@media (prefers-reduced-motion: no-preference) {
    .skill-card:hover::before { animation: spin 2.2s linear infinite; }
}
.skill-card i { font-size: 2.75rem; line-height: 1; color: var(--heading); transition: color 0.3s ease, transform 0.3s ease; }
.skill-card:hover i { color: var(--accent); transform: scale(1.08); }
.skill-name {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
@media (max-width: 575.98px) {
    .skills-grid { grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr)); gap: 0.6rem; }
    .skill-card { min-height: 6.5rem; padding: 0.9rem 0.4rem; }
    .skill-card i { font-size: 2.1rem; }
    .skill-name { font-size: 0.62rem; }
}

/* ---------- Achievements timeline: line draws on scroll ---------- */
.timeline { position: relative; margin: 0; padding-left: 3.25rem; }
.timeline::before {
    content: "";
    position: absolute;
    left: 1.3rem;
    top: 0.5rem;
    bottom: 0.5rem;
    width: 2px;
    border-radius: 2px;
    background: linear-gradient(to bottom, var(--accent), var(--accent-2));
    transform-origin: 50% 0;
}
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .timeline::before {
            animation: draw-line linear both;
            animation-timeline: view();
            animation-range: entry 10% cover 60%;
        }
    }
}
@keyframes draw-line { from { transform: scaleY(0); } to { transform: scaleY(1); } }

.timeline-item { position: relative; margin-bottom: 1.5rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-marker {
    position: absolute;
    left: -3.25rem;
    top: 1rem;
    width: 2.6rem;
    height: 2.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border-strong);
    color: var(--accent);
    font-size: 0.95rem;
    box-shadow: 0 0 0 6px var(--bg);
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}
.timeline-item:hover .timeline-marker { border-color: var(--accent); box-shadow: 0 0 0 6px var(--bg), 0 0 24px rgba(var(--accent-rgb), 0.4); }
.achievement-item { padding: 1.5rem 1.75rem; }
.achievement-date {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
}
.achievement-title { font-size: 1.25rem; margin-bottom: 0.6rem; line-height: 1.3; }
.achievement-description { color: var(--text); line-height: 1.7; font-size: 1rem; }
.achievement-description p { margin-bottom: 0.75rem; }
.achievement-description p:last-child { margin-bottom: 0; }
.achievement-description ul { padding-left: 1.5rem; margin-bottom: 0.5rem; }

@media (max-width: 575.98px) {
    .timeline { padding-left: 2.5rem; }
    .timeline::before { left: 0.9rem; }
    .timeline-marker { left: -2.5rem; width: 1.9rem; height: 1.9rem; font-size: 0.75rem; top: 1.1rem; }
    .achievement-item { padding: 1.1rem 1.2rem; }
    .achievement-title { font-size: 1.1rem; }
}

/* ---------- Projects ---------- */
.project-card { display: flex; flex-direction: column; height: 100%; }
.project-card-image img { display: block; width: 100%; height: auto; aspect-ratio: 8 / 5; object-fit: cover; }
.project-card-body { padding: 1.5rem 1.5rem 1rem; flex: 1 1 auto; }
.project-card-title { font-size: 1.2rem; margin-bottom: 0.6rem; }
.project-card-text { color: var(--text); font-size: 0.98rem; line-height: 1.6; }
.project-card-text p:last-child { margin-bottom: 0; }
.project-tech { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 1rem 0 0; }
.project-tech li {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 0.68rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}
.project-card-footer { padding: 0 1.5rem 1.5rem; }
.project-link { font-family: var(--font-heading); font-weight: 600; font-size: 0.9rem; text-decoration: none; }
.project-link:hover { text-decoration: underline; }

/* ---------- Contact ---------- */
.contact-form {
    padding: 2rem;
    border-radius: var(--radius);
    background: color-mix(in srgb, var(--surface) 85%, transparent);
    backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-sm);
}
.contact-form textarea.form-control { min-height: 9rem; }
@media (max-width: 575.98px) { .contact-form { padding: 1.25rem; } }

/* Honeypot: moved off-screen rather than display:none so bots still fill it. */
.hp-field { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }
