/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

/* --- CONTACT PAGE STYLES --- */
.contact-wrapper {
    /* position:fixed + flex centers content against the actual viewport,
       immune to parent flex/width quirks that break margin:0 auto */
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem 2rem;
    box-sizing: border-box;
    overflow-y: auto;
    z-index: 1;
}

.contact-content {
    text-align: center;
    max-width: 600px;
    width: 100%;
    padding: 2rem;
    border-radius: 16px;
    transition: background-color 0.25s ease, color 0.25s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

/* Clean CTA section */
.cta-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.contact-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25rem;
    margin-bottom: 1.5rem;
}

.contact-title {
    font-size: clamp(3rem, 5vw, 4rem);
    font-weight: 500;
    letter-spacing: -0.5px;
    color: var(--text-color);
    margin-bottom: 0.4rem;
    display: inline-block;
    white-space: nowrap;
    position: relative;
    overflow: visible;
}

.marker-underline {
    position: absolute;
    bottom: 4px;
    left: -4%;
    width: 108%;
    height: 28px;
    pointer-events: none;
    overflow: visible;
    /* Remove mix-blend-mode: multiply — kills it on dark bg */
    mix-blend-mode: normal;
    z-index: 0;
    /* behind the text */
}

body.dark-theme .marker-underline .marker-path {
    stroke: #252525;
}

body.dark-theme .marker-underline .marker-path-shadow {
    stroke: #353535;
}

.title-text {
    position: relative;
    z-index: 1;
    /* sits above the marker */
    user-select: none;
}

.marker-path {
    stroke-dasharray: 480;
    stroke-dashoffset: 480;
    animation: drawMarkerPath 4.5s ease-in-out infinite;
}

.marker-path-shadow {
    stroke-dasharray: 480;
    stroke-dashoffset: 480;
    animation: drawMarkerPath 4.5s ease-in-out infinite 0.07s;
}

@keyframes drawMarkerPath {
    0% {
        stroke-dashoffset: 480;
        opacity: 0;
    }

    8% {
        opacity: 1;
    }

    20% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    78% {
        stroke-dashoffset: 0;
        opacity: 1;
    }

    93% {
        stroke-dashoffset: 480;
        opacity: 0;
    }

    100% {
        stroke-dashoffset: 480;
        opacity: 0;
    }
}


.contact-subtitle {
    font-size: 1.1rem;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 0;
    /* Added for particle effect */
    display: inline-block;
}

/* Dynamic commission status color - only color specific words */
.contact-subtitle .missions-open {
    color: #22c55e !important;
    font-weight: 600;
    display: inline-block;
    text-shadow: 0 0 10px rgba(34, 197, 94, 0.3);
    animation: glowGreen 2s ease-in-out infinite alternate;
}

.contact-subtitle .missions-closed {
    color: #ef4444 !important;
    font-weight: 600;
    display: inline-block;
    text-shadow: 0 0 10px rgba(239, 68, 68, 0.3);
    animation: glowRed 2s ease-in-out infinite alternate;
}

@keyframes glowGreen {

    0%,
    100% {
        text-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
        transform: scale(1);
        filter: brightness(1.05);
        opacity: 1;
    }

    25% {
        text-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
        transform: scale(1.02);
        filter: brightness(1.08);
        opacity: 1;
    }

    50% {
        text-shadow: 0 0 10px rgba(34, 197, 94, 0.6);
        transform: scale(1.04);
        filter: brightness(1.12);
        opacity: 1;
    }

    75% {
        text-shadow: 0 0 12px rgba(34, 197, 94, 0.5);
        transform: scale(1.02);
        filter: brightness(1.08);
        opacity: 1;
    }

    100% {
        text-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
        transform: scale(1);
        filter: brightness(1.05);
        opacity: 1;
    }
}

@keyframes glowRed {

    0%,
    100% {
        text-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
        transform: scale(1);
        filter: brightness(1.05);
        opacity: 1;
    }

    25% {
        text-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
        transform: scale(1.02);
        filter: brightness(1.08);
        opacity: 1;
    }

    50% {
        text-shadow: 0 0 10px rgba(239, 68, 68, 0.6);
        transform: scale(1.04);
        filter: brightness(1.12);
        opacity: 1;
    }

    75% {
        text-shadow: 0 0 12px rgba(239, 68, 68, 0.5);
        transform: scale(1.02);
        filter: brightness(1.08);
        opacity: 1;
    }

    100% {
        text-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
        transform: scale(1);
        filter: brightness(1.05);
        opacity: 1;
    }
}

.character-illustration {
    margin: 1rem 0;
    display: flex;
    justify-content: center;
}

.character-illustration img {
    max-width: 200px;
    height: auto;
    border-radius: 16px;
    transition: transform 0.3s ease;
}

.character-illustration img:hover {
    transform: scale(1.05);
}

.stats-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    gap: 3rem;
    margin: 1rem 0;
    flex-wrap: wrap;
    width: 100%;
}

.stat-item {
    text-align: center;
    flex: 1;
    min-width: 90px;
    max-width: 130px;
    margin-bottom: 0;
}

.stat-number-wrapper {
    font-size: 2rem;
    font-weight: 400;
    color: var(--text-color);
    margin-bottom: 0;
    display: flex;
    align-items: baseline;
    justify-content: center;
}

.stat-suffix {
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-left: 4px;
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    font-weight: 400;
    white-space: nowrap;
    /* add this */
}

/* CTA wrapper */
.cta-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.cta-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.55;
    letter-spacing: 0.04em;
    animation: hintBounce 1.8s ease-in-out infinite;
    margin: 0;
}

@keyframes hintBounce {

    0%,
    100% {
        transform: translateY(0);
        opacity: 0.55;
    }

    50% {
        transform: translateY(5px);
        opacity: 0.85;
    }
}

.cta-sub {
    font-size: 0.72rem;
    color: var(--text-muted);
    opacity: 0.35;
    letter-spacing: 0.04em;
    margin: 0;
}

/* Start button — text-forward, no boxy border */
.cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 0;
    height: auto;
    border: none;
    border-radius: 0;
    background: transparent;
    color: var(--text-color);
    font-size: 1.15rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    outline: none;
    transition: border-color 0.2s ease, gap 0.2s ease;
}

.btn-text {
    position: relative;
    display: inline-block;
}

.btn-text::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 0px;
    left: 0;
    background-color: var(--text-color);
    transform-origin: left center;
    transform: scaleX(0.2);
    opacity: 0.4;
    transition: transform 0.4s cubic-bezier(0.19, 1, 0.22, 1), opacity 0.4s;
    will-change: transform, opacity;
}

.cta-btn:hover .btn-text::after {
    transform: scaleX(1);
    opacity: 1;
}

.btn-arrow {
    display: inline-block;
    transition: transform 0.25s ease;
    opacity: 0.6;
}

/* Hover: gap expands, arrow slides — shake/float handled by JS */
.cta-btn:hover {
    animation: none;
    gap: 0.8rem;
}

.cta-btn:hover .btn-arrow {
    transform: translateX(4px);
    opacity: 1;
}


/* Animations */
.stagger-1,
.stagger-2,
.stagger-3,
.stagger-4 {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Leave: reverse stagger — bottom items disappear first */
.stagger-4 {
    transition-delay: 0.00s;
}

.stagger-3 {
    transition-delay: 0.05s;
}

.stagger-2 {
    transition-delay: 0.10s;
}

.stagger-1 {
    transition-delay: 0.15s;
}

/* Enter state — toggled by JS adding .contact-loaded to body */
body.contact-loaded .stagger-1 {
    transition-delay: 0.10s;
}

body.contact-loaded .stagger-2 {
    transition-delay: 0.20s;
}

body.contact-loaded .stagger-3 {
    transition-delay: 0.30s;
}

body.contact-loaded .stagger-4 {
    transition-delay: 0.40s;
}

body.contact-loaded .stagger-1,
body.contact-loaded .stagger-2,
body.contact-loaded .stagger-3,
body.contact-loaded .stagger-4 {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .contact-wrapper {
        padding: 6rem 1rem 4rem;
    }

    .stats-container {
        gap: 2rem;
    }

    .stat-item {
        min-width: 80px;
    }

    .stat-number-wrapper {
        font-size: 1.5rem;
    }

    .start-button {
        padding: 0.8rem 2rem;
        font-size: 1rem;
    }
}

/* contact.css */
@media (prefers-reduced-motion: reduce) {

    .stagger-1,
    .stagger-2,
    .stagger-3,
    .stagger-4 {
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
}

/* iPhone SE (375px) */
@media (max-width: 375px) {
    .contact-wrapper {
        padding: 4rem 1rem 2rem;
    }

    .contact-title {
        font-size: 2.4rem;
    }

    .contact-subtitle {
        font-size: 0.95rem;
    }

    .character-illustration img {
        max-width: 160px;
    }

    .stats-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
        justify-items: center;
    }

    .stat-item {
        min-width: unset;
        max-width: unset;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .stat-item:last-child {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

/* iPhone 12 Pro (390px) */
@media (min-width: 376px) and (max-width: 390px) {
    .contact-title {
        font-size: 2.65rem;
    }

    .contact-subtitle {
        font-size: 0.98rem;
    }

    .stats-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
        justify-items: center;
    }

    .stat-item {
        min-width: unset;
        max-width: unset;
    }

    .stat-item:last-child {
        grid-column: 1 / -1;
        justify-self: center;
    }

    .stats-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
        justify-items: center;
    }

    .stat-item {
        min-width: unset;
        max-width: unset;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .stat-item:last-child {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

/* iPhone XR (414px) */
@media (min-width: 391px) and (max-width: 414px) {
    .contact-title {
        font-size: 2.85rem;
    }

    .contact-subtitle {
        font-size: 1rem;
    }

    .stats-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
        justify-items: center;
    }

    .stat-item {
        min-width: unset;
        max-width: unset;
    }

    .stat-item:last-child {
        grid-column: 1 / -1;
        justify-self: center;
    }

    .stats-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
        justify-items: center;
    }

    .stat-item {
        min-width: unset;
        max-width: unset;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* iPhone 14 Pro Max (430px) */
@media (min-width: 415px) and (max-width: 430px) {
    .contact-title {
        font-size: 2.85rem;
    }

    .contact-subtitle {
        font-size: 1.02rem;
    }

    .stats-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
        justify-items: center;
    }

    .stat-item {
        min-width: unset;
        max-width: unset;
    }

    .stat-item:last-child {
        grid-column: 1 / -1;
        justify-self: center;
    }

    .stats-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
        justify-items: center;
    }

    .stat-item {
        min-width: unset;
        max-width: unset;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
}

/* Samsung S20 Ultra (412px) */
@media (min-width: 391px) and (max-width: 412px) {
    .contact-title {
        font-size: 2.75rem;
    }

    .stats-container {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem 1rem;
        justify-items: center;
    }

    .stat-item {
        min-width: unset;
        max-width: unset;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .stat-item:last-child {
        grid-column: 1 / -1;
        justify-self: center;
    }
}

/* ── Explicit reset: no transform:scale on .contact-content anywhere ──────
   All breakpoints below use real layout properties only.
   This prevents the "stuck at last breakpoint" drift when resizing back. */
.contact-content {
    transform: none;
}

/* Tablets / small laptops (1024–1366px) */
@media (min-width: 1024px) and (max-width: 1366px) {
    .contact-content {
        max-width: 680px;
        padding: 2.5rem;
    }
    .contact-title {
        font-size: clamp(3.2rem, 4.5vw, 4.4rem);
    }
}

/* Surface Pro 7 (912px) */
@media (min-width: 880px) and (max-width: 960px) {
    .contact-content {
        max-width: 620px;
        padding: 2.5rem;
    }
    .contact-title {
        font-size: clamp(3rem, 4.5vw, 4rem);
    }
}

/* Surface Duo (540px) */
@media (min-width: 531px) and (max-width: 540px) {
    .contact-wrapper {
        padding: 2.5rem 1rem 2rem;
        align-items: flex-start;
    }
    .contact-content {
        max-width: 480px;
        padding: 1.5rem;
    }
    .contact-title {
        font-size: 2.5rem;
    }
    .contact-subtitle {
        font-size: 0.95rem;
    }
    .character-illustration img {
        max-width: 140px;
    }
    .stat-number-wrapper {
        font-size: 1.4rem;
    }
}

/* Nest Hub (1024×600) */
@media (min-width: 1024px) and (max-width: 1024px) and (max-height: 600px) {
    .contact-wrapper {
        align-items: flex-start;
        padding-top: 1.5rem;
        padding-bottom: 1rem;
    }
    .contact-content {
        max-width: 560px;
        gap: 0.6rem;
        padding: 1.25rem;
    }
    .contact-title {
        font-size: 2.8rem;
    }
    .contact-header {
        margin-bottom: 0.75rem;
    }
    .character-illustration img {
        max-width: 140px;
    }
    .stats-container {
        margin: 0.5rem 0;
        gap: 2rem;
    }
    .stat-number-wrapper {
        font-size: 1.5rem;
    }
}

/* Nest Hub Max (1280×800) */
@media (min-width: 1280px) and (max-width: 1280px) and (max-height: 800px) {
    .contact-wrapper {
        padding: 4rem 1rem 2rem;
    }
    .contact-content {
        max-width: 580px;
        padding: 1.75rem;
    }
    .contact-title {
        font-size: 3rem;
    }
}
