/* Local Fonts */
@font-face {
    font-family: "ABCWalterNeueMono-Regular";
    src: url("fonts/ABCWalterNeueMono-Regular.woff") format("woff");
    font-display: swap;
}

@font-face {
    font-family: "ABCGravity-Wide";
    src: url("fonts/ABCGravity-Wide.woff") format("woff");
    font-display: swap;
}

/* Base Styles & Variables */
:root {
    --bg-color-default: #ffffff;
    --text-color-default: #000000;
    --text-outline-color: transparent;
    --paper-color: #f3edcf;
    --paper-ink: #16130e;
    --paper-panel: rgba(250, 244, 218, 0.88);
    --paper-border: rgba(22, 19, 14, 0.18);
    --paper-shadow: rgba(69, 52, 25, 0.16);
    --soft-edge-size: 2rem;
    --font-mono: "ABCWalterNeueMono-Regular", monospace;
    --font-wide: var(--font-mono);
    --font-italic: var(--font-mono);
    --pop-text-fill: #f26bd1;
    --pop-text-stroke: #ff1f1f;
    --pop-stroke-width: clamp(5px, 0.08em, 10px);
    --pop-letter-spacing: -0.06em;

    --gradient-1: #f5efcf;
    --gradient-2: #efe2b6;
    --gradient-3: #fff8dd;
    --gradient-4: #e7d49e;

    --transition-speed: 0.4s;
    --border-radius-pill: 1rem;
    --border-radius-panel: 1rem;
}

/* Red Theme: Red/Cyan/Pink */
body.theme-red {
    --bg-color-default: #ff00a0;
    /* Magenta Pink */
    --text-color-default: #00c0ff;
    /* Cyan Blue */
    --text-outline-color: #ff3b00;
    /* Orange-Red */
    --paper-panel: rgba(255, 0, 160, 0.92);
    --paper-ink: #00c0ff;
    --paper-border: rgba(255, 59, 0, 0.3);
    --pop-text-fill: var(--text-color-default);
    --pop-text-stroke: var(--text-outline-color);
}

/* Blue Theme: Crimson/Pink/Teal */
body.theme-blue {
    --bg-color-default: #4a7873;
    /* Slate Teal Blue */
    --text-color-default: #ff55b7;
    /* Vibrant Pink */
    --text-outline-color: #cc0033;
    /* Crimson Red */
    --paper-panel: rgba(74, 120, 115, 0.92);
    --paper-ink: #ff55b7;
    --paper-border: rgba(204, 0, 51, 0.3);
    --pop-text-fill: var(--text-color-default);
    --pop-text-stroke: var(--text-outline-color);
}

/* Black Theme: Grey/Yellow/Green */
body.theme-black {
    --bg-color-default: #32ff00;
    /* Acid Green */
    --text-color-default: #ffd000;
    /* Darker Yellow */
    --text-outline-color: #2323c2dc;
    /* Charcoal Grey */
    --paper-panel: rgba(50, 255, 0, 0.92);
    --paper-ink: #d9b300;
    --paper-border: rgba(28, 28, 248, 0.838);
    --pop-text-fill: var(--text-color-default);
    --pop-text-stroke: var(--text-outline-color);
}

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

html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    font-family: var(--font-mono);
    font-size: 16px;
    background-color: var(--bg-color-default);
    color: var(--text-color-default);
    -webkit-font-smoothing: antialiased;
    overscroll-behavior-y: none;
}

/* Scrollbar hiding */
::-webkit-scrollbar {
    display: none;
}

/* Background Gradients */
.bg-gradient-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -2;
    background-color: var(--bg-color-default);
    opacity: 1;
    transition: background-color 0.5s ease;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

/* Intro Loader */
.intro-loader {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        radial-gradient(circle at 50% 50%, rgba(255, 31, 31, 0.09), transparent 46%),
        radial-gradient(circle at 48% 52%, rgba(242, 107, 209, 0.1), transparent 50%),
        radial-gradient(circle at 50% 50%, transparent 34%, rgba(255, 255, 255, 0.82) 78%, #ffffff 100%),
        #ffffff;
    pointer-events: all;
    overflow: hidden;
    box-shadow: inset 0 0 16vmax 10vmax rgba(255, 255, 255, 0.94);
    animation: introLayerOut 0.5s ease 2.0s forwards;
}

.intro-loader::before,
.intro-loader::after {
    content: "";
    position: absolute;
    inset: -55vmax;
    background: url("images/Swirl.svg") center / cover no-repeat;
    opacity: 0;
    mix-blend-mode: multiply;
    pointer-events: none;
}

.intro-loader::before {
    filter: invert(19%) sepia(96%) saturate(2668%) hue-rotate(348deg) brightness(105%) contrast(112%) blur(8px);
    transform: translate(-1.45rem, 0.85rem) scale(1.02) rotate(-10deg);
    animation: dreamyInkGhostBefore 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.intro-loader::after {
    filter: invert(19%) sepia(96%) saturate(4200%) hue-rotate(348deg) brightness(105%) contrast(118%) blur(9px);
    transform: translate(1.25rem, -0.95rem) scale(1.04) rotate(-8deg);
    animation: dreamyInkGhostAfter 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.intro-loader .intro-spiral {
    mix-blend-mode: multiply;
}

.intro-spiral {
    position: absolute;
    width: 150vmax;
    height: 150vmax;
    object-fit: cover;
    opacity: 0;
    filter: invert(19%) sepia(96%) saturate(4200%) hue-rotate(348deg) brightness(105%) contrast(118%) blur(4px);
    transform: scale(1.05) rotate(0deg);
    animation: dreamySpiral 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

body:not(.intro-playing) .intro-loader {
    display: none;
}

body.intro-playing .landing-content {
    pointer-events: none;
}

.persistent-swirl-background {
    position: fixed;
    top: 50%;
    left: 50%;
    z-index: 0;
    width: 150vmax;
    height: 150vmax;
    object-fit: cover;
    opacity: 0.14;
    mix-blend-mode: multiply;
    filter: invert(19%) sepia(96%) saturate(4200%) hue-rotate(348deg) brightness(105%) contrast(118%) blur(4px);
    transform: translate(-50%, -50%) rotate(20deg) scale(1.08);
    transform-origin: center;
    animation: persistentSwirlRotation 18s linear infinite;
    pointer-events: none;
}

.persistent-swirl-background[hidden] {
    display: none;
}

@keyframes persistentSwirlRotation {
    from {
        transform: translate(-50%, -50%) rotate(20deg) scale(1.08);
    }

    to {
        transform: translate(-50%, -50%) rotate(380deg) scale(1.08);
    }
}

body.intro-playing .intro-text-sequence,
body.intro-playing .landing-buttons-container {
    opacity: 0;
}

body.filter-active::after {
    content: none;
}

body.intro-complete .intro-step.step-1 {
    animation: fadeInOut 2.0s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0s forwards;
}

body.intro-complete .intro-step.step-1 .letter {
    animation: letterFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: calc(var(--char-idx) * 0.035s);
}

body.intro-complete .intro-step.step-2 {
    animation: fadeInOut 2.0s cubic-bezier(0.25, 0.46, 0.45, 0.94) 2.0s forwards;
}

body.intro-complete .intro-step.step-2 .letter {
    animation: letterFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: calc(2.0s + var(--char-idx) * 0.035s);
}

body.intro-complete .intro-step.step-3 {
    animation: fadeInMoveUp 2.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) 4.0s forwards;
}

body.intro-complete .intro-step.step-3 .letter {
    animation: letterFadeIn 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    animation-delay: calc(4.0s + var(--char-idx) * 0.035s);
}

body.intro-complete .landing-buttons-container {
    animation: fadeInButtons 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 6.2s forwards;
}

body.landing-actions-ready .landing-buttons-container {
    pointer-events: auto;
}

body.skip-landing-intro .intro-step.step-1,
body.skip-landing-intro .intro-step.step-2 {
    display: none;
}

body.skip-landing-intro .intro-step.step-3 {
    opacity: 1;
    animation: none;
    transform: translate(-50%, calc(-50% - clamp(9.5rem, 24vh, 15.5rem))) scale(1);
}

body.skip-landing-intro .intro-step.step-3 .letter {
    opacity: 1;
    animation: none;
    transform: translateY(0) scale(1);
}

body.skip-landing-intro .landing-buttons-container {
    opacity: 1;
    animation: none;
    pointer-events: auto;
}

@keyframes dreamySpiral {
    0% {
        opacity: 0;
        transform: scale(1.05) rotate(0deg);
    }

    30% {
        opacity: 0.16;
    }

    75% {
        opacity: 0.12;
        transform: scale(1.26) rotate(14deg);
    }

    100% {
        opacity: 0;
        transform: scale(3.42) rotate(20deg);
    }
}

@keyframes dreamyInkGhostBefore {
    0% {
        opacity: 0;
        transform: translate(-1.45rem, 0.85rem) scale(1.02) rotate(-10deg);
    }

    30% {
        opacity: 0.08;
    }

    75% {
        opacity: 0.06;
        transform: translate(-0.8rem, 0.5rem) scale(1.18) rotate(4deg);
    }

    100% {
        opacity: 0;
        transform: translate(0.2rem, -0.1rem) scale(3.30) rotate(12deg);
    }
}

@keyframes dreamyInkGhostAfter {
    0% {
        opacity: 0;
        transform: translate(1.25rem, -0.95rem) scale(1.04) rotate(-8deg);
    }

    30% {
        opacity: 0.08;
    }

    75% {
        opacity: 0.06;
        transform: translate(0.7rem, -0.5rem) scale(1.20) rotate(6deg);
    }

    100% {
        opacity: 0;
        transform: translate(-0.1rem, 0.1rem) scale(3.32) rotate(14deg);
    }
}

@keyframes introLayerOut {
    0% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        pointer-events: none;
    }
}

@keyframes fadeInOut {
    0% {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.98);
    }

    15% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    85% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform: translate(-50%, -55%) scale(1.02);
    }
}

@keyframes fadeInMoveUp {
    0% {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.98);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, calc(-50% - clamp(9.5rem, 24vh, 15.5rem))) scale(1);
    }
}

/* Keep the final intro headline clear of the stacked image buttons on desktop. */
@media (min-width: 769px) {
    body.intro-complete .intro-step.step-3 {
        animation-name: fadeInMoveUpDesktop;
    }

    body.skip-landing-intro .intro-step.step-3 {
        transform: translate(-50%, calc(-50% - clamp(13rem, 30vh, 22rem))) scale(1);
    }
}

@keyframes fadeInMoveUpDesktop {
    0% {
        opacity: 0;
        transform: translate(-50%, -45%) scale(0.98);
    }

    20% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    70% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, calc(-50% - clamp(13rem, 30vh, 22rem))) scale(1);
    }
}

@keyframes fadeInButtons {
    from {
        opacity: 0;
        transform: translateY(0.8rem);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes letterFadeIn {
    from {
        opacity: 0;
        transform: translateY(0.3rem) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.logo-svg-tp {
    height: 1.8rem;
    fill: currentColor;
}

.global-tp-logo {
    position: fixed;
    top: max(1.25rem, env(safe-area-inset-top));
    left: 50%;
    z-index: 115;
    display: flex;
    flex-direction: column;
    align-items: center;
    transform: translateX(-50%);
    pointer-events: none;
}

.global-tp-logo-image {
    width: auto;
    height: 0.9rem;
}

.global-tp-logo-line {
    width: 100vw;
    height: 1px;
    background-color: #000000;
    margin-top: 0.6rem;
}

.global-tp-logo[hidden] {
    display: none;
}

/* Main Content Area */
.app-main {
    width: 100%;
    height: 100%;
    padding-top: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 10;
}

/* Screens */
.app-screen {
    display: none;
    width: 100%;
    max-width: 500px;
    padding: 1.5rem;
    animation: fadeIn var(--transition-speed) ease forwards;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.app-screen.active {
    display: flex;
}

#screen-landing {
    position: fixed;
    inset: 0;
    max-width: none;
    padding: 0;
}

#screen-landing.active {
    animation: none;
}

#screen-survey {
    background: none;
    max-width: none;
    min-height: 100dvh;
    padding: clamp(1.1rem, 3vw, 2.4rem);
    justify-content: flex-start;
}

.survey-intro {
    position: fixed;
    inset: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.survey-intro[hidden] {
    display: none;
}

.survey-intro-step {
    position: absolute;
    width: min(90vw, 62rem);
    margin: 0;
    color: #000000;
    font-family: var(--font-mono);
    font-size: clamp(2rem, 6.4vw, 5.8rem);
    font-weight: normal;
    line-height: 0.95;
    letter-spacing: var(--pop-letter-spacing);
    text-align: center;
    opacity: 0;
}

.survey-intro-step-1 {
    animation: surveyIntroLine 1.4s ease forwards;
}

.survey-intro-step-2 {
    animation: surveyIntroLine 1.4s ease 1.4s forwards;
}

.survey-intro-step-3 {
    animation: surveyIntroLine 1.4s ease 2.8s forwards;
}

@keyframes surveyIntroLine {
    0% {
        opacity: 0;
        transform: translateY(0.35rem);
    }

    18%, 78% {
        opacity: 1;
        transform: translateY(0);
    }

    100% {
        opacity: 0;
        transform: translateY(-0.35rem);
    }
}

#screen-survey.survey-intro-active .tracker-card {
    opacity: 0;
    pointer-events: none;
}

#screen-trip-transition {
    position: fixed;
    inset: 0;
    max-width: none;
    padding: 0;
    overflow: hidden;
    background: #ffffff;
}

#screen-camera,
#screen-endscreen {
    position: fixed;
    inset: 0;
    isolation: isolate;
    width: 100vw;
    max-width: none;
    height: 100dvh;
    min-height: 0;
    padding: clamp(1rem, 3svh, 2rem) clamp(1rem, 3vw, 2rem);
    overflow: hidden;
}

#screen-endscreen {
    align-items: center;
    justify-content: center;
    padding: 0;
}

#screen-camera::before,
#screen-endscreen::before {
    content: "";
    position: absolute;
    top: clamp(0.85rem, 2.2svh, 1.5rem);
    bottom: clamp(0.85rem, 2.2svh, 1.5rem);
    left: 50%;
    width: calc(100vw - clamp(1rem, 3vw, 2.5rem));
    z-index: -1;
    pointer-events: none;
    background:
        radial-gradient(circle at 50% 72%, color-mix(in srgb, var(--text-color-default) 18%, transparent), transparent 54%),
        color-mix(in srgb, var(--bg-color-default) 78%, #ffffff);
    border-radius: clamp(1.5rem, 5vw, 4rem);
    filter: blur(0.85rem) saturate(1.35);
    opacity: 0.96;
    transform: translateX(-50%);
}

#screen-trip-transition.active {
    display: flex;
    animation: none;
}

.trip-transition-stage {
    position: relative;
    width: 100vw;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    isolation: isolate;
}

.trip-transition-stage::before {
    content: "";
    position: absolute;
    inset: -12vmax;
    z-index: 0;
    background:
        radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--bg-color-default) 72%, transparent), transparent 42%),
        radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.88), transparent 68%),
        #ffffff;
    opacity: 0;
    filter: blur(0);
    transform: scale(1);
}

#screen-trip-transition.trip-color-active .trip-transition-stage::before {
    opacity: 0.5;
    animation: tripWorldBlur 2.2s ease forwards;
}

.trip-color-bloom {
    position: absolute;
    left: 50%;
    top: 50%;
    z-index: 1;
    width: 22vmax;
    aspect-ratio: 1;
    border-radius: 50%;
    background:
        radial-gradient(circle, var(--bg-color-default) 0 34%, color-mix(in srgb, var(--text-color-default) 55%, var(--bg-color-default)) 56%, transparent 72%);
    opacity: 0;
    filter: blur(0.8rem) saturate(1.25);
    transform: translate(-50%, -50%) scale(0.08);
}

#screen-trip-transition.trip-color-active .trip-color-bloom {
    animation: tripColorBloom 2.2s cubic-bezier(0.2, 0.72, 0.12, 1) forwards;
}

.trip-transition-copy {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    padding: 2rem;
    text-align: center;
    letter-spacing: var(--pop-letter-spacing);
    color: var(--pop-text-fill);
    -webkit-text-stroke: var(--pop-stroke-width) var(--pop-text-stroke);
    paint-order: stroke fill;
    text-transform: uppercase;
    pointer-events: none;
    mix-blend-mode: multiply;
    text-shadow: none;
}

#screen-trip-transition.trip-ready .trip-transition-copy {
    color: var(--pop-text-fill);
    -webkit-text-stroke: var(--pop-stroke-width) var(--pop-text-stroke);
    text-shadow: none;
}

.trip-status-text {
    font-family: var(--font-wide);
    font-weight: normal;
    line-height: 0.95;
    color: #000000 !important;
    -webkit-text-stroke: 0 !important;
    text-shadow: none;
    max-width: min(88vw, 58rem);
    font-size: clamp(1.25rem, 5vw, 1.5rem);
    /* approx 24px */
    opacity: 0;
    filter: blur(0);
    transform: translateY(0.6rem) scale(0.98);
    animation: tripStatusText 3.25s ease 0.5s forwards;
}

#screen-trip-transition.trip-ready .trip-status-text {
    animation: tripReadyText 2.05s ease forwards;
}

@keyframes tripWorldBlur {
    0% {
        opacity: 0.52;
        filter: blur(0);
        transform: scale(1);
    }

    64% {
        opacity: 0.36;
        filter: blur(0.35rem);
        transform: scale(1.06);
    }

    100% {
        opacity: 0;
        filter: blur(1rem);
        transform: scale(1.14);
    }
}

@keyframes tripColorBloom {
    0% {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.08);
    }

    18% {
        opacity: 0.72;
    }

    74% {
        opacity: 0.95;
        transform: translate(-50%, -50%) scale(4.4);
    }

    100% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(7.2);
    }
}

@keyframes tripStatusText {
    0% {
        opacity: 0;
        filter: blur(0.35rem);
        transform: translateY(0.6rem) scale(0.98);
    }

    18%,
    82% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        filter: blur(0.7rem);
        transform: translateY(-0.5rem) scale(1.04);
    }
}

@keyframes tripReadyText {
    0% {
        opacity: 0;
        filter: blur(0.55rem);
        transform: translateY(0.5rem) scale(1.03);
    }

    16%,
    76% {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0) scale(1);
    }

    100% {
        opacity: 0;
        filter: blur(0.9rem);
        transform: translateY(-0.4rem) scale(1.06);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Button Component */
.button {
    font-family: var(--font-mono);
    font-size: 1rem;
    cursor: pointer;
    border: none;
    background: none;
    outline: none;
    position: relative;
    transition: transform 0.2s, filter 0.3s;
}

.btn-action-pill {
    background-color: #ffffff;
    color: var(--paper-ink);
    border-radius: var(--border-radius-pill);
    padding: 1rem 2.2rem;
    min-width: 13rem;
    text-align: center;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.btn-action-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

.btn-action-pill:active {
    transform: translateY(1px);
}

/* Landing Screen */
.landing-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
    text-align: center;
    width: 100%;
    position: relative;
}

.intro-text-sequence {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    pointer-events: none;
    z-index: 1;
}

.intro-step {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-family: var(--font-mono);
    font-size: clamp(2rem, 6.4vw, 5.8rem);
    font-weight: normal;
    line-height: 0.95;
    letter-spacing: var(--pop-letter-spacing);
    color: var(--pop-text-fill);
    text-align: center;
    opacity: 0;
    pointer-events: none;
    filter: none;
    -webkit-text-stroke: var(--pop-stroke-width) var(--pop-text-stroke);
    paint-order: stroke fill;
    text-shadow: none;
}

.intro-step .letter {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.3rem) scale(0.95);
    transform-origin: center bottom;
}

.intro-word {
    display: inline-block;
    white-space: nowrap;
}

.landing-buttons-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: min(90vw, 36rem);
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    position: relative;
    z-index: 2;
}

.landing-link {
    flex: 0 0 auto;
    width: 100%;
}

.image-link-btn {
    display: block;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    opacity: 0.96;
    line-height: 0;
    transition: none;
    -webkit-tap-highlight-color: transparent;
}

.image-link-btn:hover {
    opacity: 0.96;
    transform: none;
    filter: none;
}

.image-link-btn:active {
    transform: none;
}

.image-link-btn img {
    display: block;
    width: 100%;
    height: auto;
    pointer-events: none;
}

/* Glassmorphic Panels */
.glass-panel {
    background: var(--paper-panel);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: 0;
    border-radius: var(--border-radius-panel);
    width: 100%;
    color: var(--paper-ink);
    box-shadow:
        inset 0 0 1.4rem rgba(255, 255, 255, 0.72),
        0 18px 45px var(--paper-shadow);
    padding: 2rem;
}

/* Tracker Card */
.tracker-card {
    display: flex;
    flex-direction: column;
    gap: clamp(1.5rem, 5vh, 4.5rem);
    max-width: min(100%, 76rem);
    min-height: 100%;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.close-btn {
    background: none;
    border: none;
    color: var(--paper-ink);
    font-family: var(--font-mono);
    font-size: clamp(2.7rem, 7vw, 4.9rem);
    line-height: 1;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s, transform 0.2s;
}

.close-btn:hover {
    opacity: 1;
    transform: scale(1.1);
}

.question-container {
    min-height: min(58vh, 34rem);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.question-headline {
    font-family: var(--font-wide);
    font-size: clamp(3.4rem, 10.8vw, 8.4rem);
    font-weight: normal;
    text-align: center;
    text-transform: none;
    margin: 0 auto 1.5rem;
    line-height: 0.94;
    letter-spacing: var(--pop-letter-spacing);
    max-width: min(90vw, 58rem);
}

/* Options Grid */
.options-flex-grid {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    margin: 2rem auto 0;
    width: 100%;
    max-width: min(88vw, 44rem);
}

.option-item-btn {
    width: 100%;
    min-height: clamp(4.6rem, 15vw, 8rem);
    justify-content: center;
    background: transparent;
    border: 4px dashed var(--pop-text-stroke);
    border-radius: 0;
    padding: clamp(0.7rem, 2.5vw, 1.4rem) clamp(0.8rem, 3vw, 1.6rem);
    display: flex;
    align-items: center;
    color: var(--pop-text-fill);
    font-family: "ABCGravity-Wide", sans-serif;
    opacity: 1;
    cursor: pointer;
    transition: background-color 0.2s ease, filter 0.2s ease;
    user-select: none;
}

.option-item-btn+.option-item-btn {
    border-top: 0;
}

.option-item-btn:hover {
    background: rgba(255, 31, 31, 0.04);
    opacity: 1;
    filter: none;
}

.option-item-btn.selected {
    opacity: 1;
    transform: none;
    background: rgba(255, 31, 31, 0.08);
}

.option-icon-svg {
    display: none;
    fill: currentColor;
    transition: filter 0.3s ease;
}

.option-icon-img {
    display: none;
    filter: none;
}

.option-text-label {
    font-family: "ABCGravity-Wide", sans-serif;
    font-size: clamp(1.15rem, 4.1vw, 3.2rem);
    line-height: 0.95;
    letter-spacing: var(--pop-letter-spacing);
    text-transform: uppercase;
    font-weight: 600;
    text-align: center;
    opacity: 1;
    color: var(--pop-text-fill);
    -webkit-text-stroke: var(--pop-stroke-width) var(--pop-text-stroke);
    paint-order: stroke fill;
}

/* Camera Screen */
.camera-content-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
}

.canvas-outer-container {
    width: 100%;
    max-width: 440px;
    border-radius: var(--border-radius-panel);
    overflow: visible;
    border: 0;
    box-shadow:
        0 0 32px 12px rgba(20, 55, 132, 0.18),
        0 22px 50px rgba(69, 52, 25, 0.16);
    background: transparent;
}

.canvas-inner-relative {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: visible;
    border-radius: var(--border-radius-panel);
    isolation: isolate;
}

.canvas-inner-relative::after,
.captured-preview-container::after {
    content: "";
    position: absolute;
    inset: calc(var(--soft-edge-size) * -0.85);
    z-index: -1;
    pointer-events: none;
    border-radius: calc(var(--border-radius-panel) + var(--soft-edge-size));
    background:
        radial-gradient(circle at 20% 22%, rgba(214, 30, 40, 0.18), transparent 42%),
        radial-gradient(circle at 76% 70%, rgba(20, 55, 132, 0.28), transparent 48%),
        rgba(20, 55, 132, 0.08);
    filter: blur(1.4rem);
}

#webgl-canvas {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: var(--border-radius-panel);
    position: relative;
    z-index: 1;
}

/* Camera Control Glass */
.camera-controls-glass {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    padding: 1.15rem 1.35rem;
    width: 100%;
    max-width: 440px;
    background: #ffffff;
    border: 1px dashed rgba(0, 0, 0, 0.18);
    border-radius: var(--border-radius-panel);
    color: #000000;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

.control-section-colors {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.8;
    color: #000000 !important;
    -webkit-text-stroke: 0 !important;
}

.color-picker-row {
    display: flex;
    gap: 1rem;
    justify-content: flex-start;
    padding-bottom: 4px;
}

.color-btn {
    width: 2.2rem;
    height: 2.2rem;
    border-radius: 50%;
    border: 3px solid rgba(22, 19, 14, 0.18);
    cursor: pointer;
    transition: transform 0.25s, border-color 0.25s, box-shadow 0.25s;
    outline: none;
    position: relative;
    padding: 0;
}

.color-btn:hover {
    transform: scale(1.12);
    border-color: rgba(22, 19, 14, 0.4);
}

.color-btn.active {
    border-color: var(--paper-ink);
    transform: scale(1.18);
    box-shadow: 0 0 12px rgba(115, 81, 24, 0.28);
}

.btn-color-red {
    background-color: #d61e28;
}

.btn-color-blue {
    background-color: #143784;
}

.btn-color-black {
    background-color: #171717;
}

.control-section-actions {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    width: 100%;
}

.control-section-actions> :first-child {
    justify-self: start;
}

.control-section-actions> :nth-child(2) {
    justify-self: center;
}

.control-section-actions> :last-child {
    justify-self: end;
}

.capture-control-stack {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.45rem;
}

.capture-hint {
    position: absolute;
    top: 1.15rem;
    right: 1.35rem;
    z-index: 100;
    color: #000000 !important;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    line-height: 1.15;
    text-align: right;
    text-transform: uppercase;
    opacity: 0.8;
}

.text-link-btn {
    color: var(--paper-ink);
    background: none;
    border: none;
    font-family: var(--font-mono);
    font-size: clamp(1.35rem, 3.5vw, 2.6rem);
    text-transform: uppercase;
    cursor: pointer;
    opacity: 1;
    transition: opacity 0.2s, transform 0.2s;
}

.text-link-btn:hover {
    opacity: 1;
    transform: scale(1.05);
}

.icon-btn {
    width: 2.8rem;
    height: 2.8rem;
    border: none;
    background: transparent;
    color: var(--paper-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    opacity: 0.72;
    padding: 0;
    transition: opacity 0.2s, transform 0.2s;
}

.icon-btn:hover {
    opacity: 1;
    transform: scale(1.08);
}

.icon-btn img {
    width: 1.8rem;
    height: 1.8rem;
    display: block;
}

/* Shutter button */
.btn-shutter-outer {
    width: 4.8rem;
    height: 4.8rem;
    border-radius: 50%;
    background: #ffffff;
    border: 4px solid rgba(22, 19, 14, 0.18);
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: transform 0.2s, border-color 0.2s;
}

.btn-shutter-outer:hover {
    transform: scale(1.08);
    border-color: rgba(22, 19, 14, 0.34);
}

.btn-shutter-outer:active {
    transform: scale(0.95);
}

.btn-shutter-inner {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: #ffffff;
    border: 2px solid #000000;
    transition: background-color 0.2s;
}

.btn-shutter-outer:active .btn-shutter-inner {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Endscreen */
.endscreen-stack {
    display: flex;
    flex-direction: column;
    gap: 0;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: none;
    height: 100dvh;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: clamp(1rem, 3svh, 2rem) clamp(1rem, 3vw, 2rem);
    padding-top: clamp(3.5rem, 10svh, 6rem);
    padding-bottom: clamp(3.5rem, 10svh, 6rem);
}

.endscreen-card {
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
    align-items: center;
    text-align: center;
    width: 100%;
    max-width: min(500px, 100%);
    padding: 1.4rem 1.5rem;
    border-radius: var(--border-radius-panel);
}

.captured-preview-container {
    width: 8.5rem;
    height: 8.5rem;
    position: relative;
    border-radius: var(--border-radius-panel);
    overflow: visible;
    border: 0;
    box-shadow: 0 12px 28px rgba(69, 52, 25, 0.14);
    background: transparent;
    isolation: isolate;
}

.captured-preview-container::after {
    --soft-edge-size: 1.15rem;
    filter: blur(0.9rem);
}

.photo-preview-thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: var(--border-radius-panel);
    position: relative;
    z-index: 1;
}

.recipe-title {
    font-size: 0.95rem;
    text-transform: uppercase;
    opacity: 0.8;
}

.recipe-summary {
    font-family: var(--font-wide);
    font-style: normal;
    font-size: 1.4rem;
    line-height: 1.3;
    opacity: 0.95;
    margin-bottom: 0.5rem;
}

.recipe-intro {
    margin: 0 0 1.2rem;
}

.recipe-effects-title {
    margin: 0 0 0.35rem;
}

.recipe-effects-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.recipe-effects-list li {
    display: block;
}

.endscreen-primary-btn {
    width: 100%;
}

.restart-btn {
    padding: 0;
    background: transparent;
    font-size: 0.85rem;
    line-height: 1.2;
}

.endscreen-tp-logo {
    display: block;
    width: clamp(3rem, 16vw, 5.5rem);
    height: auto;
}

.contact-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    opacity: 0.6;
    line-height: 1.2;
}

.contact-links-row {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.contact-link {
    color: var(--paper-ink);
    text-decoration: underline;
    font-size: 0.85rem;
    opacity: 0.8;
    transition: opacity 0.2s, color 0.2s;
}

.contact-link:hover {
    opacity: 1;
    color: #9a271c;
    text-decoration: underline;
}

/* RESPONSIVE LAYOUT adjustments */
@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .logo-svg-tp {
        height: 1.4rem;
    }

    .app-main {
        padding-top: 1rem;
    }

    .intro-step {
        font-size: clamp(2rem, 8.8vw, 4.4rem);
    }

    .survey-intro-step {
        font-size: clamp(2rem, 8.8vw, 4.4rem);
    }

    .landing-buttons-container {
        width: min(92vw, 34rem);
    }

    .glass-panel {
        padding: 1.5rem;
    }

    .question-headline {
        font-size: clamp(4.2rem, 15vw, 8rem);
    }

    .option-item-btn {
        padding: 0.8rem;
    }

}

/* Footer Site Credits */
.app-footer {
    position: fixed;
    bottom: max(1.4rem, env(safe-area-inset-bottom));
    left: 50%;
    transform: translateX(-50%);
    z-index: 120;
    text-align: center;
    color: #000000;
    pointer-events: auto;
}

.site-credit-trigger,
.site-credit-link {
    font-family: var(--font-mono);
    font-size: 0.6rem;
    color: currentColor;
    text-decoration: none;
    opacity: 0.45;
    transition: opacity 0.3s;
    text-transform: uppercase;
}

.site-credit-trigger {
    border: 0;
    background: transparent;
    cursor: pointer;
}

.site-credit-trigger:hover,
.site-credit-link:hover {
    opacity: 0.9;
}

.site-credits-modal {
    position: fixed;
    inset: 0;
    z-index: 260;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 1.5rem 1rem max(3.4rem, env(safe-area-inset-bottom));
    background: rgba(255, 255, 255, 0.08);
    color: #000000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.site-credits-modal[hidden] {
    display: none;
}

.site-credits-modal.open {
    opacity: 1;
    pointer-events: auto;
}

.site-credits-dialog {
    position: relative;
    width: max-content;
    max-width: calc(100vw - 2rem);
    padding: 1.1rem 2.2rem 1.1rem 1.1rem;
    background: #ffffff;
    color: #000000;
    border: 1px solid #000000;
    text-align: left;
    transform: translateY(1rem);
    transition: transform 0.22s ease;
}

.site-credits-modal.open .site-credits-dialog {
    transform: translateY(0);
}

.site-credits-close {
    position: absolute;
    top: 0.45rem;
    right: 0.55rem;
    border: 0;
    background: transparent;
    color: #000000;
    font-family: var(--font-mono);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.7;
}

.site-credit-row {
    margin: 0 0 0.8rem;
    font-family: var(--font-mono);
    font-size: 0.62rem;
    line-height: 1.35;
    text-transform: uppercase;
}

.site-credit-row:last-child {
    margin-bottom: 0;
}

.site-credit-legal {
    white-space: nowrap;
}

.site-credits-dialog .site-credit-link {
    color: #000000;
    opacity: 1;
    text-decoration: underline;
    text-underline-offset: 0.14em;
}

/* Canvas Logo Watermark */
.canvas-logo-watermark {
    position: absolute;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 105;
    pointer-events: none;
    /* Let drag/drops pass through */
    transition: opacity 0.3s;
}

.canvas-logo-watermark .logo-svg-tp {
    height: 1rem;
    fill: #ffffff;
    /* Clean white watermark */
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
    display: block;
}

/* Video Recording Overlay & Indicator */
.recording-indicator {
    position: absolute;
    top: 1.25rem;
    right: 1.25rem;
    background-color: rgba(0, 0, 0, 0.65);
    color: #ffffff;
    padding: 0.35rem 0.65rem;
    border-radius: var(--border-radius-panel);
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-family: var(--font-mono);
    font-size: 0.7rem;
    z-index: 105;
    pointer-events: none;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.recording-dot {
    width: 8px;
    height: 8px;
    background-color: #d61e28;
    border-radius: 50%;
    animation: flash-dot 1s infinite steps(2, start);
}

@keyframes flash-dot {
    to {
        visibility: hidden;
    }
}

/* Shutter Button Recording Morph State */
.btn-shutter-outer.recording {
    border-color: rgba(214, 30, 40, 0.4);
    box-shadow: 0 0 15px rgba(214, 30, 40, 0.6);
}

.btn-shutter-outer.recording .btn-shutter-inner {
    background-color: #d61e28;
    border-radius: 1rem;
    /* morph circular core into a rounded square */
    transform: scale(0.65);
    animation: pulse-recording 1.2s infinite ease-in-out;
}

@keyframes pulse-recording {
    0% {
        transform: scale(0.65);
        opacity: 1;
    }

    50% {
        transform: scale(0.5);
        opacity: 0.7;
    }

    100% {
        transform: scale(0.65);
        opacity: 1;
    }
}

/* Disable iOS Text Selection Magnifier & Callouts globally on interactive widgets */
body,
button,
.camera-controls-glass,
.btn-shutter-outer,
.btn-shutter-inner,
.color-btn,
.icon-btn,
.text-link-btn {
    -webkit-user-select: none;
    -webkit-touch-callout: none;
    user-select: none;
}

/* Progress Overlay Styling */
.progress-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    /* Ignore clicks while hidden */
    transition: opacity 0.3s ease;
}

.progress-overlay.visible {
    opacity: 1;
    pointer-events: auto;
    /* Catch clicks while visible to prevent double tapping */
}

.progress-card {
    width: 280px;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.progress-title {
    font-family: var(--font-wide);
    font-size: 0.85rem;
    text-transform: uppercase;
    color: #ffffff;
}

.progress-bar-container {
    width: 100%;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-panel);
    overflow: hidden;
    position: relative;
}

.progress-bar-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, #d61e28, #143784);
    border-radius: var(--border-radius-panel);
    transition: width 0.1s linear;
}

.progress-percent {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    opacity: 0.8;
}

/* ==========================================
   POP-ART 3-COLOR SYSTEM OVERRIDES
   ========================================== */

/* Headings, titles, link buttons & close buttons: Outline text style using original fonts */
.recipe-title,
#recipe-summary-text,
.button-text,
.text-link-btn,
.close-btn,
.progress-title {
    text-transform: uppercase;
    color: #000000 !important;
    -webkit-text-stroke: 0 !important;
    text-shadow: none !important;
}

.intro-step,
.question-headline,
#screen-survey .text-link-btn,
#screen-survey .close-btn {
    color: #000000 !important;
    letter-spacing: var(--pop-letter-spacing);
    -webkit-text-stroke: 0 !important;
    text-shadow: none !important;
}

.question-headline {
    text-transform: none !important;
}

/* Specific button text style to invert colors (fill is background, stroke is outline) */
.btn-action-pill .button-text {
    color: var(--bg-color-default) !important;
    -webkit-text-stroke: 1.5px var(--text-outline-color) !important;
}

/* Pop-art Action Button shape styling (thick border, NO shadow, solid color) */
.btn-action-pill {
    background-color: var(--text-color-default) !important;
    border: 3px solid var(--text-outline-color) !important;
    border-radius: var(--border-radius-pill) !important;
    box-shadow: none !important;
    /* No shadow */
    transition: transform 0.1s ease !important;
}

.btn-action-pill:hover,
.btn-action-pill:active {
    transform: none !important;
    box-shadow: none !important;
}

/* Pop-art Glass Panels overrides (thick border, NO shadow, solid colored backdrop) */
.glass-panel {
    background: var(--paper-panel) !important;
    border: 3px solid var(--text-outline-color) !important;
    box-shadow: none !important;
    /* No shadow */
    border-radius: var(--border-radius-panel) !important;
    color: var(--text-color-default) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

.tracker-card.glass-panel {
    background: #ffffff !important;
    border: 0 !important;
}

#screen-survey .tracker-card.glass-panel {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.endscreen-card.glass-panel {
    background: #ffffff !important;
    border: 0 !important;
    box-shadow: none !important;
}

#screen-endscreen,
#screen-endscreen .endscreen-card,
#screen-endscreen .recipe-title,
#screen-endscreen #recipe-summary-text,
#screen-endscreen .contact-title,
#screen-endscreen .contact-link,
#screen-endscreen .restart-btn {
    color: #000000 !important;
    -webkit-text-stroke-color: transparent !important;
    text-shadow: none !important;
}

#screen-camera .camera-controls-glass.glass-panel {
    background: #ffffff !important;
    border: 1px dashed rgba(0, 0, 0, 0.18) !important;
    border-radius: var(--border-radius-panel) !important;
    box-shadow: none !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}

#screen-endscreen .endscreen-card.glass-panel {
    border-radius: var(--border-radius-panel) !important;
}

#screen-endscreen .endscreen-card.glass-panel+.endscreen-card.glass-panel {
    border-top: 1px dashed rgba(0, 0, 0, 0.18) !important;
}

#screen-endscreen .restart-btn {
    margin: 0 !important;
    padding: 0 !important;
    width: auto !important;
    background: transparent !important;
    border-radius: 0 !important;
    font-size: 0.85rem !important;
    line-height: 1.2 !important;
    transform: none !important;
}

#screen-endscreen .restart-btn:hover,
#screen-endscreen .restart-btn:active {
    transform: none !important;
}

/* Scrollable layout elements and contact sections */
.contact-title,
.contact-link {
    color: var(--text-color-default) !important;
    text-transform: uppercase;
}

/* Force white background on landing screen while maintaining themed typography */
body.landing-active,
body.landing-active .bg-gradient-container,
body.filter-active,
body.filter-active .bg-gradient-container {
    background-color: #ffffff !important;
}
