/* ==========================================================================
   Design tokens — shared across all pages.
   Link this BEFORE any page-specific stylesheet.
   ========================================================================== */

:root {
    /* Colour palette */
    --primary-color: #4C9AFF;
    --secondary-color: #94A3B8;
    --background-color: #0F172A;
    --surface-color: #1E293B;
    --surface-color-dark: #162032;
    --text-color: #CBD5E1;
    --heading-color: #F1F5F9;
    --accent-color: #FF8F73;
    --border-color: #334155;
    --success-color: #57D9A3;
    --highlight-bg: rgba(76, 154, 255, 0.1);
    --highlight-bg-dark: rgba(126, 182, 255, 0.18);

    /* Header */
    --header-bg: rgba(30, 41, 59, 0.95);
    --header-bg-dark: rgba(15, 23, 42, 0.97);
    --header-height: 70px;
    --header-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 1px 2px rgba(0, 0, 0, 0.1);
    --header-shadow-dark: 0 2px 8px rgba(0, 0, 0, 0.4), 0 1px 3px rgba(0, 0, 0, 0.3);
    --header-text: #ffffff;
    --header-text-dark: #F1F5F9;

    /* Typography */
    --font-primary: 'Poppins', sans-serif;
    --base-font-size: 16px;

    /* Layout */
    --container-max-width: 1200px;
}

/* Prevent images from overflowing their containers on any page */
img {
    max-width: 100%;
    height: auto;
}

/* ── Shared sub-page: Back to Home button ───────────────────────────────── */
.back-home-btn {
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 1100;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 1.1rem;
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #F1F5F9;
    border: 1px solid rgba(76, 154, 255, 0.35);
    border-radius: 2rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    white-space: nowrap;
    line-height: 1; /* prevent page-level line-height inheritance inflating button height */
    min-height: 44px; /* WCAG touch target */
}

.back-home-btn:hover {
    background: var(--primary-color, #4C9AFF);
    border-color: var(--primary-color, #4C9AFF);
    color: #fff;
    transform: translateX(-3px);
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(76, 154, 255, 0.45);
}

.back-home-btn i {
    font-size: 0.8rem;
    transition: transform 0.2s ease;
}

.back-home-btn:hover i {
    transform: translateX(-2px);
}

@media (max-width: 480px) {
    .back-home-btn span { display: none; }  /* icon only on very small screens */
    .back-home-btn { padding: 0.55rem 0.9rem; }
}

/* ── Accessibility utilities ─────────────────────────────────────────────── */

/* Visible keyboard focus ring on all interactive elements */
*:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 3px;
    border-radius: 3px;
}

/* Skip-to-content link (hidden until focused) */
.skip-link {
    position: fixed;
    top: -100%;
    left: 1rem;
    z-index: 9999;
    padding: 0.75rem 1.25rem;
    background: var(--primary-color);
    color: #fff;
    font-weight: 600;
    border-radius: 0 0 8px 8px;
    text-decoration: none;
    transition: top 0.2s ease;
}
.skip-link:focus {
    top: 0;
    outline: none;
}

/* Visually hidden but screen-reader accessible */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ── Page entrance fade ──────────────────────────────────────────────────── */
body {
    animation: pageFadeIn 0.35s ease both;
}

@keyframes pageFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
    /* NOTE: never use transform here — transform on body breaks position:fixed for all children */
}

@media (prefers-reduced-motion: reduce) {
    body { animation: none; }
}
