/* ===========================
   CSS Custom Properties
   =========================== */
:root {
    /* Colors */
    --brand-dark: #000000;
    --brand-light: #FFF6E5;
    --accent: #FF3D00;
    --overlay: rgba(0, 0, 0, 0.75);

    /* Spacing */
    --container-padding: 64px;
    --container-gap: 48px;
    --header-gap: 24px;

    /* Container Dimensions */
    --container-width: min(1312px, calc(100vw - 128px));
    --container-height: auto;
    --container-radius: 32px;

    /* Logo */
    --logo-max-width: 498px;
    --logo-max-height: 127px;

    /* Progress Bar */
    --progress-max-width: 600px;
    --progress-height: 4px;
    --progress-fill: 70%;

    /* Typography */
    --font-serif: 'Instrument Serif', Georgia, serif;
    --font-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --tagline-size: 64px;
    --tagline-line-height: 64px;
    --social-size: 20px;

    /* Animation */
    --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ===========================
   Reset & Base Styles
   =========================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 4px;
}

body {
    background-color: var(--brand-dark);
    color: var(--brand-light);
    font-family: var(--font-sans);
    min-height: 100vh;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

/* ===========================
   Layout
   =========================== */
.page-wrapper {
    position: relative;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 49px;
    padding: 96px var(--container-padding);
    overflow: hidden;
}

/* ===========================
   Page Header
   =========================== */
.page-header {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--header-gap);
    width: 100%;
    flex-wrap: wrap;
}

.badge {
    flex-shrink: 0;
    width: 100%;
    max-width: 500px;
}

.badge img {
    width: 100%;
    height: auto;
    display: block;
}

.tagline {
    font-family: var(--font-serif);
    font-size: var(--tagline-size);
    line-height: var(--tagline-line-height);
    font-weight: 400;
    font-style: normal;
    text-align: center;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===========================
   Main Container
   =========================== */
.main-container {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--container-gap);
    padding: var(--container-padding);
    width: var(--container-width);
    flex: 1;
    min-height: 0;
    border-radius: var(--container-radius);
    background-image: url('../assets/images/background.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    --bg-opacity: 1;
}

/* Overlay — starts solid black (hides image), fades down to the design's 0.75 darkness */
.main-container::before {
    content: '';
    position: absolute;
    inset: 0;
    background-color: #000;
    opacity: var(--bg-opacity);
    border-radius: inherit;
    z-index: 1;
}

/* Initial fullscreen state */
.main-container.fullscreen {
    width: 100vw;
    height: 100vh;
    border-radius: 0;
    position: fixed;
    top: 0;
    left: 0;
    padding: 0;
    z-index: 100;
}

.main-container.fullscreen::before {
    border-radius: 0;
}

/* Initially hidden (kept in flow so the morph target position is correct) */
.page-header,
.social-links {
    opacity: 0;
}

/* Content above overlay */
.main-container > * {
    position: relative;
    z-index: 2;
}

/* ===========================
   Logo Container
   =========================== */
.logo-container {
    width: 100%;
    max-width: var(--logo-max-width);
    height: auto;
    flex-shrink: 0;
}

/* ===========================
   Progress Bar
   =========================== */
.progress-bar {
    position: relative;
    display: flex;
    width: 100%;
    max-width: var(--progress-max-width);
    height: var(--progress-height);
    opacity: 0;
    flex-shrink: 0;
}

.progress-fill {
    background-color: var(--accent);
    height: 100%;
    width: 0%;
    flex-shrink: 0;
}

.progress-empty {
    background-color: var(--brand-dark);
    height: 100%;
    flex: 1;
    min-width: 1px;
}

/* Percentage counter that tracks the leading edge of the fill */
.progress-percent {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    transform: translateX(-50%);
    font-family: var(--font-sans);
    font-size: 14px;
    line-height: 1;
    color: var(--accent);
    white-space: nowrap;
    font-variation-settings: "wdth" 100;
    font-variant-numeric: tabular-nums;
}

/* ===========================
   Social Links
   =========================== */
.social-links {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    opacity: 0;
}

.social-links p {
    font-family: var(--font-sans);
    font-size: var(--social-size);
    font-weight: 400;
    line-height: normal;
    white-space: nowrap;
    font-variation-settings: "wdth" 100;
}

.icons {
    display: flex;
    gap: 8px;
    align-items: center;
}

.icon-facebook,
.icon-instagram {
    display: block;
    width: 32px;
    height: 32px;
    cursor: pointer;
    /* Initial scale(0) is applied by GSAP, then cleared on reveal so :hover works. */
    transition: transform 0.3s ease, filter 0.3s ease;
}

.icon-facebook:hover,
.icon-instagram:hover {
    transform: scale(1.1);
    /* brightness(0) normalizes source to black, then the chain maps to #FF3D00 */
    filter: brightness(0) invert(36%) sepia(91%) saturate(6020%) hue-rotate(8deg) brightness(104%) contrast(102%);
}

.icon-facebook img,
.icon-instagram img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* ===========================
   Initial Animation States
   =========================== */
.page-header {
    opacity: 0;
}

/* ===========================
   Responsive Design - Tablet
   =========================== */
@media (max-width: 1024px) {
    :root {
        --container-padding: 64px;
        --container-width: min(896px, calc(100vw - 128px));
        --container-height: 836px;
        --tagline-size: 64px;
        --tagline-line-height: 64px;
    }

    .page-wrapper {
        padding: 96px var(--container-padding);
        gap: 76px;
    }

    .page-header {
        flex-direction: column;
        gap: 24px;
    }

    .tagline {
        max-width: 896px;
        white-space: normal;
    }
}

/* ===========================
   Responsive Design - Mobile
   =========================== */
@media (max-width: 768px) {
    :root {
        --container-padding: 32px;
        --container-width: calc(100vw - 64px);
        --container-height: 438px;
        --container-gap: 48px;
        --tagline-size: 56px;
        --tagline-line-height: 64px;
        --logo-max-width: 364px;
    }

    .page-wrapper {
        padding: 64px var(--container-padding);
        gap: 64px;
    }

    .page-header {
        flex-direction: column;
        gap: 24px;
    }

    .badge svg {
        max-width: 364px;
    }

    .tagline {
        max-width: 364px;
        white-space: normal;
        text-align: center;
    }

    .main-container {
        padding: 48px;
    }
}

/* ===========================
   Accessibility - Reduced Motion
   =========================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ===========================
   Performance Optimizations
   =========================== */
.animating {
    will-change: transform, opacity;
}

.logo-container.animating {
    will-change: clip-path;
}

.main-container.animating {
    will-change: width, height, border-radius;
}
