/* ─────────────────────────────────────────────────────────────────────────
   site.css — Shared styles for nathantalvarez.com
   All pages link to this file instead of duplicating these styles inline.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Base ──────────────────────────────────────────────────────────────── */
body {
    overflow: auto;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
body.modal-open { overflow: hidden; }

.font-montserrat {
    font-family: 'Montserrat', 'Inter', sans-serif;
}

/* ── Image protection ───────────────────────────────────────────────────── */
img, picture, figure {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* ── Screen-reader only (SEO hidden content) ───────────────────────────── */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── 3D Button Effect ───────────────────────────────────────────────────── */
.button-3d-effect {
    transition: all 0.2s ease-out;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}
.button-3d-effect:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15), 0 4px 6px -2px rgba(0, 0, 0, 0.1);
}
.button-3d-effect:active {
    transform: translateY(1px);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1), inset 0 2px 4px rgba(0, 0, 0, 0.25);
}
.button-3d-effect.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: translateY(0) !important;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06) !important;
}

/* ── Card hover (home page focus-area cards) ───────────────────────────── */
.card-hover-effect {
    transition: transform 0.3s ease-out, box-shadow 0.3s ease-out;
}
.card-hover-effect:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.15);
}
.focus-area-card {
    background-color: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(229, 231, 235, 0.6);
    border-radius: 1.5rem;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}
.shadow-hero {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12), 0 0 10px rgba(59, 130, 246, 0.05);
}

/* ── Glass card (about / contact / cvresume pages) ─────────────────────── */
.glass-card {
    background-color: rgba(255, 255, 255, 0.75);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
}
.shadow-section {
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.12), 0 0 10px rgba(59, 130, 246, 0.05);
}

/* ── About page visual refresh ─────────────────────────────────────────── */
.about-shell {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at 5% 10%, rgba(14, 165, 233, 0.16), transparent 36%),
        radial-gradient(circle at 94% 6%, rgba(16, 185, 129, 0.15), transparent 34%),
        linear-gradient(180deg, #f8fbff 0%, #f4f8ff 45%, #f8fafc 100%);
}

.about-shell::before,
.about-shell::after {
    content: '';
    position: absolute;
    border-radius: 999px;
    filter: blur(2px);
    pointer-events: none;
}

.about-shell::before {
    width: 280px;
    height: 280px;
    top: -90px;
    right: -100px;
    background: rgba(59, 130, 246, 0.12);
}

.about-shell::after {
    width: 220px;
    height: 220px;
    left: -80px;
    bottom: 20%;
    background: rgba(6, 182, 212, 0.12);
}

.about-proof-chip {
    border: 1px solid rgba(30, 64, 175, 0.16);
    background: rgba(255, 255, 255, 0.75);
    box-shadow: 0 8px 16px -12px rgba(30, 64, 175, 0.45);
}

.about-hero-frame {
    border: 1px solid rgba(147, 197, 253, 0.5);
    background: linear-gradient(120deg, rgba(255, 255, 255, 0.9), rgba(239, 246, 255, 0.85));
}

.about-focus-card {
    background: linear-gradient(140deg, rgba(255, 255, 255, 0.93), rgba(248, 250, 252, 0.96));
    border: 1px solid rgba(203, 213, 225, 0.72);
}

.about-focus-card h3 {
    letter-spacing: 0.01em;
}

.about-zigzag-track {
    position: relative;
}

.about-zigzag-track::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 0.7rem;
    bottom: 0.7rem;
    width: 1px;
    background: linear-gradient(180deg, rgba(147, 197, 253, 0.2), rgba(59, 130, 246, 0.35), rgba(147, 197, 253, 0.2));
}

.about-zigzag-step {
    position: relative;
}

.about-zigzag-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.7));
    border: 1px solid rgba(147, 197, 253, 0.35);
    box-shadow: 0 14px 24px -20px rgba(37, 99, 235, 0.7);
}

.about-zigzag-tag {
    display: inline-flex;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.11);
    color: #1d4ed8;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.about-photo-zigzag {
    position: relative;
}

.about-photo-zigzag::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    top: 1rem;
    bottom: 1rem;
    width: 1px;
    background: linear-gradient(180deg, rgba(186, 230, 253, 0.2), rgba(59, 130, 246, 0.3), rgba(186, 230, 253, 0.2));
}

.about-photo-row {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    position: relative;
}

.about-photo-media {
    border-radius: 1rem;
    overflow: hidden;
    border: 1px solid rgba(125, 211, 252, 0.35);
    box-shadow: 0 14px 24px -18px rgba(37, 99, 235, 0.6);
    background: #f8fafc;
}

.about-photo-image {
    width: 100%;
    height: 210px;
    object-fit: cover;
}

.about-photo-card {
    border-radius: 1rem;
    border: 1px solid rgba(147, 197, 253, 0.35);
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.94), rgba(239, 246, 255, 0.7));
    padding: 1.1rem;
    box-shadow: 0 14px 24px -20px rgba(37, 99, 235, 0.7);
}

.about-journey-line {
    border-left: 2px solid rgba(59, 130, 246, 0.3);
}

.about-journey-item {
    position: relative;
}

.about-journey-item::before {
    content: '';
    position: absolute;
    left: -1.2rem;
    top: 0.35rem;
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(191, 219, 254, 0.6);
}

.about-grad-track {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 1.2rem;
    position: relative;
}

.about-grad-track::before {
    content: '';
    position: absolute;
    left: 0.5rem;
    top: 0.35rem;
    bottom: 0.35rem;
    width: 2px;
    background: linear-gradient(180deg, rgba(147, 197, 253, 0.25), rgba(37, 99, 235, 0.4), rgba(147, 197, 253, 0.25));
}

.about-grad-step {
    position: relative;
    padding-left: 1.9rem;
}

.about-grad-dot {
    position: absolute;
    left: 0.16rem;
    top: 0.25rem;
    width: 0.7rem;
    height: 0.7rem;
    border-radius: 999px;
    background: #2563eb;
    box-shadow: 0 0 0 4px rgba(191, 219, 254, 0.65);
}

.about-grad-content {
    background: rgba(255, 255, 255, 0.68);
    border: 1px solid rgba(191, 219, 254, 0.55);
    border-radius: 0.9rem;
    padding: 0.85rem 0.95rem;
}

.about-grad-label {
    margin: 0;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1d4ed8;
}

.about-personal-grid .about-personal-card {
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(203, 213, 225, 0.64);
}

.about-personal-grid .about-personal-card:nth-child(3) {
    background: linear-gradient(135deg, rgba(254, 252, 232, 0.95), rgba(255, 255, 255, 0.9));
    border-color: rgba(245, 158, 11, 0.26);
}

/* ── Footer link — center-out underline animation ──────────────────────── */
.footer-link {
    position: relative;
    text-decoration: none;
    padding-bottom: 4px;
    color: #4B5563;
    transition: color 0.3s ease-in-out;
}
.footer-link::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #3B82F6;
    transform: scaleX(0);
    transform-origin: center;
    transition: transform 0.3s ease-in-out;
    animation: none;
}
.footer-link:hover::after { transform: scaleX(1); }

.footer-link.active {
    color: #1D4ED8 !important;
    font-weight: 600 !important;
}
.footer-link.active::after {
    transform: scaleX(1);
    transition: none;
}
.footer-link.active:hover::after {
    animation: footerLinkReset 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
.footer-link.active:not(:hover)::after {
    transform: scaleX(1);
    transition: none;
    animation: none;
}
.footer-link.active:hover {
    color: #2559a8 !important;
    transition: color 0.3s ease-in-out;
}

/* ── About page subtle enter animation ─────────────────────────────────── */
.about-fade-in {
    opacity: 0;
    transform: translateY(10px);
    animation: aboutFadeIn 0.45s ease-out forwards;
}
.about-delay-1 { animation-delay: 0.06s; }
.about-delay-2 { animation-delay: 0.14s; }
.about-delay-3 { animation-delay: 0.22s; }
.about-delay-4 { animation-delay: 0.3s; }

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

@media (prefers-reduced-motion: reduce) {
    .about-fade-in {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 768px) {
    .about-shell::before,
    .about-shell::after {
        opacity: 0.6;
    }

    .about-zigzag-track::before {
        left: 0.5rem;
        transform: none;
    }

    .about-zigzag-step {
        padding-left: 1.3rem;
    }

    .about-photo-zigzag::before {
        left: 0.5rem;
        transform: none;
    }

    .about-photo-row {
        padding-left: 1.3rem;
    }
}

@media (min-width: 768px) {
    .about-photo-row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: center;
        gap: 1.1rem;
    }

    .about-photo-row-right .about-photo-media {
        grid-column: 2;
    }

    .about-photo-row-right .about-photo-card {
        grid-column: 1;
        grid-row: 1;
    }

    .about-grad-track {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 0.9rem;
        padding-top: 1.45rem;
    }

    .about-grad-track::before {
        left: 8%;
        right: 8%;
        top: 0.62rem;
        bottom: auto;
        width: auto;
        height: 2px;
        background: linear-gradient(90deg, rgba(147, 197, 253, 0.25), rgba(37, 99, 235, 0.4), rgba(147, 197, 253, 0.25));
    }

    .about-grad-step {
        padding-left: 0;
        padding-top: 0.9rem;
    }

    .about-grad-dot {
        left: 50%;
        transform: translateX(-50%);
        top: -0.14rem;
    }

    .about-grad-content {
        height: 100%;
    }
}

@keyframes footerLinkReset {
    0%   { transform: scaleX(0); }
    100% { transform: scaleX(1); }
}

/* ── Contact page ───────────────────────────────────────────────────────── */
.contact-icon {
    width: 1.75rem;
    height: 1.75rem;
    stroke-width: 1.5;
    transition: color 0.3s ease-in-out, transform 0.3s ease-in-out;
}
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-6px); }
}
.floating-item { animation: float 4s ease-in-out infinite; }

/* ── PDF viewer ─────────────────────────────────────────────────────────── */
.pdf-content-area {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding-top: 129.41%; /* 8.5 × 11 aspect ratio */
    height: 0;
}
.pdf-content-area iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

/* ── Full-screen PDF modal ──────────────────────────────────────────────── */
.pdf-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0, 0, 0, 0.75);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease-out;
    pointer-events: none;
}
.pdf-modal-overlay.show { opacity: 1; pointer-events: auto; }

.pdf-modal-content {
    background: white;
    padding: 1rem;
    border-radius: 1rem;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    width: 90%; height: 90%;
    max-width: 1200px; max-height: 900px;
    transform: scale(0.95);
    transition: transform 0.3s ease-out;
}
.pdf-modal-overlay.show .pdf-modal-content { transform: scale(1); }

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}
.modal-header h3 { font-size: 1.5rem; font-weight: 700; color: #1F2937; }

.pdf-modal-iframe-wrapper {
    flex-grow: 1;
    position: relative;
    width: 100%; height: 100%;
    overflow: hidden;
}
.pdf-modal-iframe-wrapper iframe { width: 100%; height: 100%; border: none; }

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
}
.modal-close-button {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    color: #4B5563;
    transition: color 0.2s ease-in-out;
    cursor: pointer;
}
.modal-close-button:hover { color: #EF4444; }

/* ── Research page — animated content panel ─────────────────────────────── */
.chart-bar { transition: height 0.5s ease-in-out; }
.content-fade-enter-active { animation: contentFadeIn 0.4s ease-in-out; }
@keyframes contentFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Mobile responsive overrides ────────────────────────────────────────── */

/* PDF mobile card — hidden on desktop, shown on mobile instead of the embed */
.pdf-mobile-card { display: none; }

/* Mobile study details bottom sheet */
.mobile-sheet-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
    z-index: 1100;
    overscroll-behavior: contain;
    touch-action: none;
}
.mobile-sheet-overlay.show {
    opacity: 1;
    pointer-events: auto;
}

.mobile-sheet-panel {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 78vh;
    max-height: 78vh;
    background: #f8fafc;
    border-top-left-radius: 1rem;
    border-top-right-radius: 1rem;
    box-shadow: 0 -12px 30px rgba(0, 0, 0, 0.2);
    padding: 0.75rem 1rem 1rem;
    transform: translateY(100%);
    transition: transform 0.28s ease;
    overflow: hidden;
    touch-action: pan-y;
    display: flex;
    flex-direction: column;
}
.mobile-sheet-panel.show {
    transform: translateY(0);
}

.mobile-sheet-handle {
    width: 44px;
    height: 5px;
    border-radius: 999px;
    background: #cbd5e1;
    margin: 0.1rem auto 0.75rem;
    touch-action: none;
}

.mobile-sheet-drag-zone {
    touch-action: none;
}

.mobile-sheet-content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

@media (max-width: 767px) {
    /* Swap iframe embed for tap-to-open card on phones/small tablets */
    .pdf-content-area { display: none; }
    .pdf-mobile-card   { display: flex; }
}

@media (max-width: 640px) {
    /* PDF modal: not full-screen on phones so outside-tap close is obvious */
    .pdf-modal-overlay {
        padding: 0.75rem;
    }
    .pdf-modal-content {
        width: 94vw;
        height: 92dvh;
        max-width: 680px;
        max-height: 92dvh;
        padding: 0.25rem;
        border-radius: 0.9rem;
    }
    .modal-header {
        padding: 0.75rem 0.9rem;
        min-height: 3rem;
    }
    .modal-header h3 {
        font-size: 0.95rem;
        line-height: 1.2;
        max-width: 80%;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .modal-footer {
        padding: 0.6rem 0.75rem;
        gap: 0.5rem;
        justify-content: stretch;
    }
    .modal-footer a {
        flex: 1;
        text-align: center;
        padding: 0.6rem 0.5rem;
        font-size: 0.85rem;
    }
    .modal-close-button {
        font-size: 2rem;
        line-height: 1;
        padding: 0.15rem 0.4rem;
    }
    .pdf-modal-iframe-wrapper,
    .pdf-modal-iframe-wrapper iframe {
        width: 100%;
        height: 100%;
        min-width: 0;
    }
    .pdf-modal-iframe-wrapper {
        overflow-x: hidden;
        overflow-y: auto;
    }
    .pdf-modal-iframe-wrapper iframe {
        width: 118%;
        height: 118%;
        transform: scale(0.85);
        transform-origin: top left;
    }

    /* Footer: smaller gap between links on very small screens */
    .footer-link {
        display: inline-flex;
        align-items: center;
        min-height: 44px;
        padding-left: 0.25rem;
        padding-right: 0.25rem;
        font-size: 0.9rem;
    }

    /* Touch-friendly 3D buttons: disable hover lift on touch devices */
    .button-3d-effect:hover {
        transform: none;
    }
    .button-3d-effect:active {
        transform: translateY(1px);
    }
}
