/* Home page styles. Loaded after styles.css so cascade order is preserved. */

/* ---- Layout ----------------------------------------------------------- */

body {
    min-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
}

header {
    padding: 20px;
    position: relative;
    z-index: 10;
    display: flex;
    justify-content: space-between;
}

main {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
    overflow: hidden;
}

footer {
    padding: 20px;
    position: relative;
    z-index: 10;
    font-size: 0.8rem;
}

.header-content {
    flex-direction: column;
    margin-bottom: 20px;
    justify-content: center;
    width: 100%;
}

#logo {
    width: var(--logo-w, 240px);
    margin-right: 0;
    margin-bottom: 15px;
    transition: transform 0.3s ease, filter 0.3s ease;
}

#logo:hover {
    transform: translateY(-5px);
    filter: drop-shadow(0 8px 15px rgba(0, 150, 226, 0.4));
}

/* ---- About button & modal -------------------------------------------- */

.about-btn {
    position: absolute;
    left: 20px;
    top: 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 150, 226, 0.3);
    transition: all 0.3s ease;
    z-index: 100;
    font-size: 24px;
}

.about-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 150, 226, 0.5);
}

.about-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.about-modal.visible {
    opacity: 1;
    visibility: visible;
}

.about-content {
    background: var(--box-bg);
    width: 90%;
    max-width: 700px;
    max-height: 85vh;
    border-radius: 20px;
    padding: 30px;
    overflow-y: auto;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transform: translateY(-30px);
    transition: all 0.3s ease;
    position: relative;
}

.about-modal.visible .about-content {
    transform: translateY(0);
}

.about-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.3s ease;
}

.about-close:hover {
    transform: rotate(90deg);
    color: var(--accent-color);
}

.about-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    gap: 20px;
}

.about-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 150, 226, 0.3);
}

.about-title h2 {
    margin: 0 0 5px 0;
    font-size: 1.8em;
}

.about-vname {
    font-size: 0.9em;
    opacity: 0.8;
    margin: 0 0 5px 0;
}

.about-job-title {
    font-style: italic;
    font-size: 1.1em;
    opacity: 0.9;
    margin: 5px 0;
}

.about-section {
    margin-bottom: 25px;
}

.about-section h3 {
    border-bottom: 1px solid var(--box-border);
    padding-bottom: 8px;
    margin-bottom: 15px;
    font-size: 1.3em;
}

.about-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
}

.about-list li {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}

.about-list li i {
    margin-right: 10px;
    color: var(--accent-color);
    margin-top: 2.5px;
}

.about-link {
    color: var(--accent-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.about-link:hover {
    text-decoration: underline;
}

/* ---- Wave background ------------------------------------------------- */
/* Three SVG-masked layers, each painted with a theme-aware CSS variable
   so wave colors update with light/dark theme. The mask is a single-color
   SVG; the actual color comes from background-color. */

.waves {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
    transition: filter 0.5s ease-in-out, opacity 0.5s ease-in-out;
}

/* When a panel is active, defocus the waves to match the main-box. */
body:has(.content-container.active) .waves {
    filter: blur(4px);
    opacity: 0.5;
}

.wave {
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 200%;
    height: 198px;
    background-repeat: repeat-x;
    background-size: 1600px 100%;
    -webkit-mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 198' preserveAspectRatio='none'><path fill='black' d='M.005 121C311 121 409.898-.25 811 0c400 0 500 121 789 121v77H0s.005-48 .005-77z'/></svg>");
            mask-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1600 198' preserveAspectRatio='none'><path fill='black' d='M.005 121C311 121 409.898-.25 811 0c400 0 500 121 789 121v77H0s.005-48 .005-77z'/></svg>");
    -webkit-mask-repeat: repeat-x;
            mask-repeat: repeat-x;
    -webkit-mask-size: 1600px 100%;
            mask-size: 1600px 100%;
    -webkit-mask-position: 0 130%;
            mask-position: 0 130%;
    animation: wave 25s linear infinite forwards;
    z-index: 5;
}

.wave-1 { background-color: var(--wave-color-1); opacity: 0.10; }
.wave-2 { background-color: var(--wave-color-2); opacity: 0.08; animation-delay: -8s; }
.wave-3 { background-color: var(--wave-color-3); opacity: 0.05; animation-delay: -16s; }

@keyframes wave {
    0%   { -webkit-mask-position: 0 130%;       mask-position: 0 130%; }
    100% { -webkit-mask-position: 1600px 130%;  mask-position: 1600px 130%; }
}

/* ---- Main / secondary box layout ------------------------------------- */

.content-container {
    display: flex;
    transition: all 0.5s ease-in-out;
    height: 100%;
    width: 100%;
    position: relative;
}

.main-box {
    flex: 1;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    transition: all 0.5s ease-in-out;
    position: relative;
    width: 100%;
    transform: translateX(0);
    z-index: 10;
}

.secondary-box {
    position: absolute;
    right: -100%;
    height: 100%;
    width: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: all 0.5s ease-in-out;
    opacity: 0;
    z-index: 11;
    pointer-events: none;
}

.main-box:hover,
.secondary-box:hover {
    z-index: 12;
}

.content-container.active {
    width: 100%;
}

.content-container.active .main-box {
    width: 50%;
    transform: translateX(-22%) scale(0.92);
    pointer-events: none;
    filter: blur(4px);
    opacity: 0.5;
}

.content-container.active .secondary-box {
    right: 0;
    opacity: 1;
    transform: translateX(-5%);
    pointer-events: auto;
}

.box {
    border: 1px solid var(--box-border);
    background: var(--box-bg);
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--box-shadow);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    max-width: 600px;
    width: 80%;
    transition: all 0.5s ease-in-out;
}

/* ---- Icon grid (the 6 buttons in the main box) ----------------------- */

.icon-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 30px;
    text-align: center;
}

.icon-grid .bottom-row {
    grid-column: span 3;
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-top: 10px;
}

.icon-item,
.social-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.icon-item:hover,
.social-link:hover {
    transform: translateY(-10px);
}

.icon-circle,
.social-circle {
    width: var(--circle-size, 80px);
    height: var(--circle-size, 80px);
    background: var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--circle-mb, 15px);
    color: white;
    font-size: var(--circle-font, 32px);
    box-shadow: 0 4px 15px rgba(0, 150, 226, 0.3);
}

.icon-label,
.social-label {
    font-weight: 500;
    color: var(--text-primary);
}

.cycling-icon-container {
    width: var(--circle-size, 80px);
    height: var(--circle-size, 80px);
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: var(--circle-mb, 15px);
    transition: transform 0.3s ease;
}

.cycling-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 4px 15px rgba(0, 150, 226, 0.3));
    transition: transform 0.2s;
}

.icon-item:hover .cycling-icon {
    transform: scale(1.1);
}

/* ---- Secondary-box content (video / social / contact panels) --------- */

.video-container {
    width: 100%;
}

.video-container iframe {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.video-description {
    margin-top: 15px;
    text-align: center;
    font-style: italic;
    color: var(--text-secondary);
}

.social-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
}

.back-button {
    margin-top: 20px;
    padding: 10px 20px;
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 150, 226, 0.3);
}

/* ---- Surprise-again (primary in-panel cycle button) ------------------ */

.surprise-again {
    margin: 18px auto 4px;
    padding: 13px 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: min(320px, 100%);
    background: linear-gradient(135deg,
        var(--accent-color) 0%,
        color-mix(in srgb, var(--accent-color) 65%, white) 100%);
    color: white;
    border: none;
    border-radius: 999px;
    font-family: 'Geist', sans-serif;
    font-weight: 600;
    font-size: 0.98rem;
    letter-spacing: 0.01em;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 8px 22px rgba(0, 150, 226, 0.38),
        inset 0 1px 0 rgba(255, 255, 255, 0.28);
    transition: transform .25s ease, box-shadow .25s ease;
}

.surprise-again::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(115deg,
        transparent 35%,
        rgba(255, 255, 255, 0.38) 50%,
        transparent 65%);
    transform: translateX(-110%);
    transition: transform .8s ease;
    pointer-events: none;
}

.surprise-again:hover {
    transform: translateY(-2px);
    box-shadow:
        0 12px 28px rgba(0, 150, 226, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.surprise-again:hover::before { transform: translateX(110%); }
.surprise-again:active { transform: translateY(0) scale(0.97); }

.surprise-again .shuffle-ico,
.surprise-again .arrow-ico {
    font-size: 0.92em;
    will-change: transform;
}

.surprise-again .arrow-ico {
    transition: transform .25s ease;
    opacity: 0.92;
}

.surprise-again:hover .arrow-ico { transform: translateX(5px); }

@keyframes surprise-spin-in {
    from { transform: rotate(-200deg) scale(0.4); opacity: 0; }
    to   { transform: rotate(0) scale(1); opacity: 1; }
}

@keyframes surprise-nudge {
    0%, 88%, 100% { transform: rotate(0); }
    91% { transform: rotate(-14deg); }
    95% { transform: rotate(14deg); }
}

.surprise-again .shuffle-ico {
    animation:
        surprise-spin-in .55s cubic-bezier(.34, 1.56, .64, 1) both,
        surprise-nudge 3.6s ease-in-out 1.2s infinite;
}

.surprise-again:hover .shuffle-ico { animation-play-state: running, paused; }

/* Demote the back button when it follows the video panel */
.video-container ~ .back-button {
    background: transparent;
    color: var(--text-secondary);
    box-shadow: none;
    font-weight: 400;
    font-size: 0.88rem;
    padding: 6px 14px;
    margin-top: 6px;
    opacity: 0.65;
}

.video-container ~ .back-button:hover {
    background: transparent;
    box-shadow: none;
    transform: translateY(-1px);
    opacity: 1;
    color: var(--accent-color);
}

/* When a side panel is active, dim the left-side surprise icon so the
   in-panel "surprise me again" button is the only target. */
.content-container.active #surpriseBtn {
    pointer-events: none;
    opacity: 0.4;
    filter: grayscale(0.5);
    transition: opacity .3s ease, filter .3s ease;
}

/* Reusable helpers for inline-styled bits inside JS-injected panels */
.panel-heading {
    text-align: center;
    margin-bottom: 20px;
}

.panel-center {
    text-align: center;
    margin-bottom: 20px;
}

.contact-email {
    margin-top: 15px;
    font-weight: bold;
}

.contact-icon {
    max-width: 130px;
    margin: 10px auto;
    width: 100%;
    height: auto;
    display: block;
    filter: drop-shadow(0 8px 15px rgba(0, 150, 226, 0.4));
}

.contact-send-btn {
    background: var(--accent-color);
    color: white;
    border: none;
    border-radius: 10px;
    padding: 10px 20px;
    cursor: pointer;
    font-weight: bold;
}

/* ---- Quote tooltip --------------------------------------------------- */

.quote-tooltip {
    position: absolute;
    display: none;
    z-index: 9999;
    padding: 20px;
    background-color: var(--box-bg);
    border: 1px solid var(--accent-color);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
    border-radius: 10px;
    max-width: 500px;
    opacity: 0;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    transform: translateY(10px);
}

.quote-tooltip.visible {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.quote-tooltip p {
    margin: 0 0 10px 0;
    line-height: 1.6;
    color: var(--text-primary);
}

.quote-tooltip footer {
    font-size: 0.9em;
    text-align: right;
    color: var(--text-secondary);
    width: auto;
    padding: 0;
}

/* ---- Photo collage --------------------------------------------------- */

.collage-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.collage-item {
    flex-grow: 1;
    height: 300px;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s ease-in-out;
    min-width: 150px;
}

.collage-item.visible {
    opacity: 1;
    transform: translateY(0);
}

.collage-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease-in-out;
}

.collage-item:hover img {
    transform: scale(1.1);
}

.collage-item:last-child {
    flex-grow: 0;
}

/* ---- Responsive -----------------------------------------------------
   Width breakpoints set per-rule; height breakpoints parameterize the
   shared sizing variables (--logo-w, --circle-size, --circle-mb,
   --circle-font) so a single declaration in each rule scales them all. */

@media (max-width: 768px) {
    .box { width: 90%; padding: 20px; }
    .icon-grid { grid-gap: 15px; }
    :root { --circle-size: 60px; --circle-font: 24px; }
    .header-content { flex-direction: column; }
    #logo { margin-right: 0; margin-bottom: 10px; }
}

@media (max-width: 550px) {
    .content-container.active { flex-direction: column; }

    .content-container.active .main-box {
        width: 100%;
        transform: translateY(-100%);
        opacity: 0;
        height: auto;
        position: absolute;
    }

    .content-container.active .secondary-box {
        width: 90%;
        right: auto;
        left: 5%;
        height: auto;
        transform: none;
        position: relative;
    }

    .secondary-box .box {
        max-height: 70vh;
        overflow-y: auto;
        padding: 15px;
        width: 100%;
        box-sizing: border-box;
    }

    .secondary-box h2 { font-size: 1.3rem; margin-bottom: 15px; }
    .secondary-box p { font-size: 0.9rem; margin-bottom: 10px; }

    .back-button {
        position: sticky;
        bottom: 5px;
        margin-top: 10px;
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    :root { --circle-size: 50px; --circle-font: 20px; }
}

@media (max-width: 400px) {
    .secondary-box .box { padding: 12px; max-height: 65vh; }
    .secondary-box h2 { font-size: 1.1rem; margin-bottom: 10px; }
    .secondary-box p { font-size: 0.85rem; }
    .secondary-box img { max-width: 100px !important; margin: 8px auto !important; }
}

@media (max-width: 768px) {
    .collage-item { height: 150px; min-width: 120px; }
}

@media (max-width: 480px) {
    .collage-item { height: 120px; min-width: 100px; }
    .collage-container { gap: 8px; }
}

@media (max-height: 800px) {
    :root {
        --logo-w: 180px;
        --circle-size: 65px;
        --circle-font: 26px;
        --circle-mb: 10px;
    }
    h1 { font-size: 1.6em; margin: 5px 0; }
    h3 { font-size: 1em; margin: 5px 0; }
    .box { padding: 20px; max-width: 550px; }
    footer { padding: 10px; }
    .icon-grid { grid-gap: 20px; }
    .icon-grid .bottom-row { gap: 5px; }
    #logo { margin-bottom: 10px; }
}

@media (max-height: 650px) {
    :root {
        --logo-w: 120px;
        --circle-size: 50px;
        --circle-font: 20px;
        --circle-mb: 5px;
    }
    h1 { font-size: 1.3em; margin: 3px 0; }
    h3 { font-size: 0.8em; margin: 3px 0; }
    .box { padding: 15px; max-width: 500px; overflow-y: auto; }
    .icon-label { font-size: 0.8em; }
    footer { padding: 5px; }
    .icon-grid { grid-gap: 10px; }
    #logo { margin-bottom: 5px; }
    .about-btn {
        width: 40px;
        height: 40px;
        font-size: 18px;
        left: 15px;
        top: 15px;
    }
}

@media (max-height: 500px) {
    :root {
        --logo-w: 100px;
        --circle-size: 40px;
        --circle-font: 16px;
    }
    .header-content { margin-bottom: 10px; width: auto; flex: 0 0 auto; margin-right: 10px; }
    .icon-item { flex-basis: calc(33% - 15px); }
    .main-box {
        flex-direction: row;
        align-items: center;
        justify-content: space-around;
    }
    .box {
        flex: 1;
        margin-left: 10px;
        max-height: 90%;
        overflow-y: auto;
    }
}
