/* Code Frontiers holding page */

:root {
    /* Colours */
    --bg: #0a0a1a;
    --text: #ffffff;
    --brand-blue: #4d8cff;
    --brand-purple: #c056ff;
    --cta-blue: #2f6ae6;    /* Deeper brand colours so white button text passes WCAG AA (4.5:1) */
    --cta-purple: #9b45e6;
    --accent-glow: 86, 193, 255;
    --muted: #8f9bc4;

    /* Fonts */
    --font-ui: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial,
        sans-serif;
    --font-brand: 'Sora', var(--font-ui);

    /* Page spacing, adjusted per breakpoint below. The top and bottom values grow automatically to clear
       the notch and home indicator, which viewport-fit=cover lets content run under. */
    --pad-top: 1.5rem;
    --pad-bottom: 1.5rem;
    --header-pad: 0.5rem;
    --footer-pad-x: 1rem;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-ui);
    background-color: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    overflow-y: auto;
    min-height: 100vh;
    min-height: 100dvh; /* Visible screen height, tracking mobile browser toolbars */
    display: flex;
    flex-direction: column;
}

/* Visible to screen readers and search engines only */
.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;
}

/* Stacking: starfield at the back, then the globe and footer, with the header (and its button) on top
   so globe labels never cover it */
#stars {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

#canvas-container,
footer {
    position: relative;
    z-index: 1;
}

header {
    position: relative;
    z-index: 2;
}

/* Header */

header {
    padding: var(--header-pad);
    padding-top: max(var(--pad-top), env(safe-area-inset-top));
    text-align: center;
}

h1 {
    font-family: var(--font-brand);
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    margin-bottom: 0.6rem;
}

.wordmark-text {
    background: linear-gradient(90deg, var(--brand-blue), var(--brand-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.tagline {
    font-weight: 300;
    font-size: 1.3rem;
    opacity: 0.8;
    margin-bottom: 0.2rem;
}

.since {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
    margin-top: 0.5rem;
}

.contact-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin-top: 1.1rem;
    padding: 0.75rem 1.6rem;
    border: none;
    border-radius: 30px;
    background: linear-gradient(90deg, var(--cta-blue), var(--cta-purple));
    color: var(--text);
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3), 0 0 0 1px rgba(255, 255, 255, 0.08) inset;
    transition: transform 0.2s, box-shadow 0.2s;
}

.contact-btn:hover,
.contact-btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4), 0 0 24px rgba(var(--accent-glow), 0.45),
        0 0 0 1px rgba(255, 255, 255, 0.15) inset;
}

.contact-btn:focus-visible {
    outline: 2px solid var(--text);
    outline-offset: 3px;
}

/* Globe */

#canvas-container {
    flex: 1;
    min-height: 300px;
}

canvas {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Service labels, positioned over their dots by the script */
.tooltip {
    position: absolute;
    left: 0;
    top: 0;
    min-width: 80px;
    padding: 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background-color: rgba(0, 0, 0, 0.8);
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.5);
    color: var(--text);
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Footer */

footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: auto;
    padding: 0.3rem var(--footer-pad-x);
    padding-bottom: max(var(--pad-bottom), env(safe-area-inset-bottom));
    font-size: 0.8rem;
    text-align: center;
}

.copyright {
    opacity: 0.7;
}

/* Phones and small tablets */
@media (max-width: 768px) {
    :root {
        --pad-top: 1.2rem;
        --pad-bottom: 1.2rem;
        --header-pad: 0.4rem;
        --footer-pad-x: 0.3rem;
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 0.4rem;
    }

    .tagline {
        font-size: 1rem;
        margin-bottom: 0.1rem;
    }

    .contact-btn {
        margin-top: 0.9rem;
    }

    #canvas-container {
        min-height: 250px;
    }
}

/* Phones in portrait: a fixed-height globe area rather than filling the remaining space */
@media (max-width: 768px) and (orientation: portrait) {
    #canvas-container {
        flex: 0 0 auto;
        height: 464px;
    }
}

/* Short screens (eg. iPhone SE, small laptop windows). Comes after the phone rules so its tighter header
   padding wins on short phones. */
@media (max-height: 700px) {
    :root {
        --pad-top: 1.2rem;
        --header-pad: 0.3rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    .tagline {
        font-size: 0.9rem;
    }

    #canvas-container {
        min-height: 200px;
    }
}

/* Short phones in portrait: trim the globe area so the footer stays on screen */
@media (max-width: 768px) and (orientation: portrait) and (max-height: 700px) {
    #canvas-container {
        height: 424px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .contact-btn {
        transition: none;
    }

    .contact-btn:hover,
    .contact-btn:focus-visible {
        transform: none;
    }
}
