/* ========================================
   CSS Custom Properties (Design Tokens)
   ======================================== */
:root {
    /* Colors */
    --color-dark-bg: #1a3d3a;
    --color-bright-green: #00ff88;
    --color-bright-green-dark: #00cc66;
    --color-white: #ffffff;
    --color-text-dark: #1a3d3a;

    /* Gradients */
    --gradient-green: linear-gradient(180deg, #00ff88 0%, #00cc66 100%);
    --gradient-bg: linear-gradient(180deg, #1a3d3a 0%, #1a3d3a 60%, #00ff88 100%);

    /* Typography */
    --font-family: 'Boehringer Forward Head', -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', 'Roboto', sans-serif;
    --font-size-title-large: 3.5rem;
    --font-size-title-compact: 2rem;
    --font-size-body: .8rem;
    --font-size-button: 1.125rem;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1rem;
    --spacing-lg: 4rem;
    --spacing-xl: 3rem;
    --spacing-2xl: 4rem;

    /* Layout */
    --max-width-mobile: 375px;
    --border-radius: 8px;
    --border-radius-lg: 12px;

    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* ========================================
   Font Face
   ======================================== */
@font-face {
    font-family: 'Boehringer Forward Head';
    src: url('assets/BoehringerForwardHead-Md.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    font-family: var(--font-family);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

body {
    background: var(--color-dark-bg);
    color: var(--color-white);
}

/* ========================================
   Screen Container
   ======================================== */
.screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-dark-bg);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
    overflow: hidden;
    -webkit-overflow-scrolling: touch;
    align-items: center;
}

.screen.active {
    opacity: 1;
    visibility: visible;
}

/* Camera Container */
.camera-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background-color: #000;
}

/* AR Loading State */
.ar-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    color: var(--color-white);
    text-align: center;
    padding: 20px;
    font-size: 1.1rem;
    line-height: 1.5;
    align-items: center;
}

.ar-loading .spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: var(--color-bright-green);
    animation: spin 1s ease-in-out infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Ensure content is above camera */
#screen-2 .screen-content {
    background-color: transparent;
    position: relative;
    z-index: 2;
    height: 100%;
    pointer-events: none;
    align-items: center;
    /* Allow clicks to pass through to camera */
}

/* Make buttons and interactive elements clickable */
#screen-2 .btn,
#screen-2 .instruction-container,
#screen-2 .title-container-compact {
    pointer-events: auto;
}

.screen-content {
    padding: var(--spacing-md) var(--spacing-md) 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
}

/* ========================================
   Typography
   ======================================== */
.title-container {
    text-align: center;
    margin-bottom: var(--spacing-md);
    position: relative;
    z-index: 10;
}

.title {
    font-size: var(--font-size-title-large);
    font-weight: 700;
    line-height: 1.1;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.title-white {
    color: var(--color-white);
    font-style: normal;
    letter-spacing: 0.05em;
}

.title-green {
    color: var(--color-bright-green);
    font-style: italic;
    font-weight: 700;
    letter-spacing: -0.02em;
}

/* Logo Images */
.logo-large {
    width: 100%;
    max-width: 280px;
    height: auto;
    object-fit: contain;
}

.logo-small {
    width: 100%;
    max-width: 200px;
    height: auto;
    object-fit: contain;
}

.title-container-compact {
    text-align: center;
    margin-top: 30px;
}

.title-compact {
    font-size: var(--font-size-title-compact);
    font-weight: 700;
    line-height: 1.2;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
}

.instruction-text {
    font-size: var(--font-size-body);
    line-height: 1.5;
    text-align: center;
    color: var(--color-text-dark);
    margin: var(--spacing-md) 0;
    padding: 0 var(--spacing-md);
}

.instruction-text-white {
    font-size: var(--font-size-body);
    line-height: 1.5;
    text-align: center;
    color: var(--color-white);
    margin: var(--spacing-md) 0;
    padding: 0 var(--spacing-md);
}

/* ========================================
   Screen 1: Splash Screen
   ======================================== */
#screen-1 {
    background: var(--gradient-bg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}


.screen-background {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background-image: url('assets/Wolf Image.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-image {
    position: relative;
    width: 100%;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    z-index: 0;
}

.wolf-image {
    width: 100%;
    height: auto;
    max-height: 100%;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 10px 30px rgba(0, 255, 136, 0.3));
}

/* ========================================
   Illustrations
   ======================================== */
.illustration-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) 0;
    max-height: 50vh;
    align-items: center;
}

.illustration {
    width: 100%;
    max-width: 300px;
    height: auto;
}

.icon-illustration {
    width: auto;
    max-width: 200px;
    max-height: 200px;
    object-fit: contain;
}

/* ========================================
   Touch Effect Animation (Screen 4)
   ======================================== */
.touch-effect .ripple {
    animation: ripple-pulse 2s ease-in-out infinite;
    transform-origin: center;
}

.touch-effect .ripple-1 {
    animation-delay: 0s;
}

.touch-effect .ripple-2 {
    animation-delay: 0.3s;
}

.touch-effect .ripple-3 {
    animation-delay: 0.6s;
}

.touch-effect .arc {
    animation: arc-fade 2s ease-in-out infinite;
    stroke-dasharray: 50;
    stroke-dashoffset: 50;
}

.touch-effect .arc-1 {
    animation-delay: 0s;
}

.touch-effect .arc-2 {
    animation-delay: 0.2s;
}

.touch-effect .arc-3 {
    animation-delay: 0.4s;
}

.touch-effect .arc-4 {
    animation-delay: 0.6s;
}

.touch-effect .arc-5 {
    animation-delay: 0.8s;
}

@keyframes ripple-pulse {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }

    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

@keyframes arc-fade {
    0% {
        opacity: 0;
        stroke-dashoffset: 50;
    }

    50% {
        opacity: 1;
        stroke-dashoffset: 0;
    }

    100% {
        opacity: 0;
        stroke-dashoffset: -50;
    }
}

/* ========================================
   Instruction Container
   ======================================== */
.instruction-container {
    margin: var(--spacing-md) 0;
    text-align: center;
}

/* ========================================
   CTA Section
   ======================================== */
.cta-section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0 100px;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    margin: 20px 0;
    align-items: center;
}

.cta-section-1 {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 0 100px;
    position: relative;
    z-index: 10;
    flex-shrink: 0;
    margin: 20px 0;
    align-items: center;
}

/* ========================================
   Buttons
   ======================================== */
.btn {
    width: 80%;
    max-width: 310px;
    padding: 12px 24px;
    font-size: var(--font-size-button);
    font-weight: 600;
    font-family: var(--font-family);
    border: none;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all var(--transition-normal);
    text-transform: none;
    letter-spacing: 0.02em;
    -webkit-tap-highlight-color: transparent;
    margin: 10px 0;
}

.btn:active {
    transform: scale(0.98);
}

.btn-dark {
    background: var(--color-dark-bg);
    color: var(--color-bright-green);
    border: 2px solid var(--color-dark-bg);
}

.btn-dark:hover {
    background: rgba(26, 61, 58, 0.8);
    border-color: var(--color-bright-green);
}

.btn-bright {
    background: var(--color-bright-green);
    color: var(--color-text-dark);
}

.btn-bright:hover {
    background: var(--color-bright-green-dark);
    border-color: var(--color-bright-green-dark);
    transform: translateY(-2px);
}

/* ========================================
   Logo
   ======================================== */
.logo-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px var(--spacing-md) 25px;
    z-index: 100;
    background: linear-gradient(to top, rgba(26, 61, 58, 0.9) 0%, rgba(26, 61, 58, 0) 100%);
    pointer-events: none;
}

.logo-container img {
    pointer-events: auto;
}

.logo {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-inverted {
    height: 40px;
    width: auto;
    object-fit: contain;
    filter: invert(100%);
}

/* ========================================
   Responsive Design
   ======================================== */
@media (min-width: 376px) {
    .screen-content {}
}

@media (min-width: 768px) {
    :root {
        --font-size-title-large: 4rem;
        --font-size-title-compact: 2.5rem;
    }

    .screen-content {}

    .btn {
        max-width: 350px;
    }
}

@media (max-height: 667px) {
    :root {
        --font-size-title-large: 2.5rem;
        --spacing-lg: 1rem;
        --spacing-xl: 1.5rem;
        --font-size-button: 1rem;
    }

    .hero-image {
        max-height: 40vh;
    }

    .illustration {
        max-width: 200px;
    }

    .cta-section,
    .cta-section-1 {
        padding: 10px 0 80px;
    }

    .logo-container {
        padding: 10px var(--spacing-md) 15px;
    }

    .logo,
    .logo-inverted {
        height: 30px;
    }
}

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

.btn:focus-visible {
    outline: 3px solid var(--color-bright-green);
    outline-offset: 3px;
}

/* ========================================
   Loading State
   ======================================== */
body.loading .screen {
    pointer-events: none;
}

/* ========================================
   AR Controls (Restart UI)
   ======================================== */
.ar-controls {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    z-index: 1001;
    /* Above everything else */
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 var(--spacing-md);
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0) 100%);
    pointer-events: none;
    /* Let clicks pass through empty areas */
}

.ar-controls>* {
    pointer-events: auto;
    /* Re-enable for children */
}

.btn-text {
    background: transparent;
    border: none;
    color: var(--color-white);
    font-size: 1.1rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 10px;
    font-family: var(--font-family);
}

.btn-text svg {
    stroke: var(--color-white);
}

.logo-container-ar {
    display: flex;
    align-items: center;
}

.logo-ar {
    height: 32px;
    width: auto;
    filter: invert(100%);
    /* Make sure it's white for dark bg */
}

/* Ensure nice spacing on iPhone X+ */
@media (min-height: 800px) {
    .ar-controls {
        padding-bottom: 20px;
        height: 100px;
    }
}