/**
 * Summit Template - Landing Page Styles
 * Self-contained: fonts, variables, layout, components
 */

/* ── Font ────────────────────────────────────────────────────── */
@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 100 700;
    font-display: block;
    src: url('../assets/fonts/material-symbols-outlined.ttf') format('truetype');
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 25px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: 'liga';
}

/* ── Variables (Summit Palette) ──────────────────────────────── */
:root {
    --hills: #315C4D;
    --skies: #569AAB;
    --blooms: #F48020;
    --golden: #D2AB4E;
    --dark: #181819;
    --medium: #595A5F;
    --light: #F4F4F0;

    --vp-font-family-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    --card-border-radius: 12px;

    --vp-c-bg: #F4F4F0;
    --vp-c-bg-soft: #ECECE8;
    --vp-c-bg-mute: #E2E2DE;
    --vp-c-text-1: rgba(24, 24, 25);
    --vp-c-text-2: rgba(24, 24, 25, 0.72);
    --vp-c-text-3: rgba(24, 24, 25, 0.50);
    --vp-c-divider: rgba(24, 24, 25, 0.12);
    --vp-c-border: rgba(24, 24, 25, 0.18);
    --vp-c-brand-1: #315C4D;
    --vp-c-brand-2: #274A3E;
    --vp-c-brand-3: #1F3D32;
    --vp-c-brand-soft: rgba(49, 92, 77, 0.14);
    --vp-c-info: #569AAB;
}

html.dark {
    --vp-c-bg: #181819;
    --vp-c-bg-soft: #222224;
    --vp-c-bg-mute: #2E2E30;
    --vp-c-text-1: rgba(244, 244, 240, 0.90);
    --vp-c-text-2: rgba(244, 244, 240, 0.65);
    --vp-c-text-3: rgba(244, 244, 240, 0.40);
    --vp-c-divider: rgba(89, 90, 95, 0.32);
    --vp-c-border: rgba(89, 90, 95, 0.48);
    --vp-c-brand-1: #5CB899;
    --vp-c-brand-2: #4D9E82;
    --vp-c-brand-3: #408A70;
    --vp-c-brand-soft: rgba(92, 184, 153, 0.14);
    --vp-c-info: #7DC5D4;
}

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

html {
    overflow: hidden;
    background-color: var(--vp-c-bg);
}

body {
    font-family: var(--vp-font-family-base);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background-color: var(--vp-c-bg);
    margin: 0;
    min-height: 100vh;
    overflow: hidden;
}

/* ── Keyframes ───────────────────────────────────────────────── */
@keyframes bounce {
    from, 6.66%, 17.66%, 33.33% {
        animation-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translate3d(0, 0, 0);
    }
    13.33%, 14.33% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translate3d(0, -20px, 0) scaleY(1.05);
    }
    23.33% {
        animation-timing-function: cubic-bezier(0.755, 0.05, 0.855, 0.06);
        transform: translate3d(0, -10px, 0) scaleY(1.02);
    }
    26.66% {
        transition-timing-function: cubic-bezier(0.215, 0.61, 0.355, 1);
        transform: translate3d(0, 0, 0) scaleY(0.98);
    }
    30% {
        transform: translate3d(0, -3px, 0) scaleY(1.01);
    }
}

/* ── Main Container ──────────────────────────────────────────── */
#app-landing {
    background-color: var(--vp-c-bg);
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
}

/* ── Background ──────────────────────────────────────────────── */
#app-background {
    height: 100vh;
    height: 100dvh;
    left: 0;
    overflow: hidden;
    position: fixed;
    top: 0;
    right: 0;
    width: 100vw;
    z-index: 1;
    background:
        linear-gradient(135deg, rgba(244, 244, 240, 0.92) 0%, rgba(236, 236, 232, 0.85) 50%, rgba(244, 244, 240, 0.95) 100%),
        url('../assets/images/bg-pattern.jpg') center / cover no-repeat;
    transition: opacity 0.3s ease;
}

html.dark #app-background {
    background:
        linear-gradient(135deg, rgba(24, 24, 25, 0.92) 0%, rgba(34, 34, 36, 0.85) 50%, rgba(24, 24, 25, 0.95) 100%),
        url('../assets/images/bg-pattern.jpg') center / cover no-repeat;
}

#app-background-image {
    height: 100%;
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* ── Idle State (like logged-out) ────────────────────────────── */
#app-landing.idle #app-info {
    margin-left: 40px;
    opacity: 1;
    transform: translateX(0%);
}

#app-landing.idle #app-background {
    cursor: pointer;
}

#app-landing.idle #reveal-button-wrapper {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -40px);
    visibility: visible;
}

/* ── Revealed State (show card) ──────────────────────────────── */
#app-landing.revealed #app-background {
    opacity: 0.5;
}

#app-landing.revealed #app-card-wrapper {
    opacity: 1;
    pointer-events: all;
    transform: translate(-50%, -50%) scale(1);
    visibility: visible;
}

#app-landing.revealed #app-info {
    margin-left: 40px;
    opacity: 1;
    transform: translateX(0%);
}

/* ── Time & Date ─────────────────────────────────────────────── */
#app-info {
    bottom: 0;
    left: 0;
    margin: 40px;
    margin-left: 0;
    opacity: 0;
    position: absolute;
    transform: translateX(-100%);
    transition: margin 250ms, opacity 250ms, transform 250ms;
    z-index: 2;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.time-weather-row {
    display: flex;
    flex-direction: row;
    align-items: baseline;
    gap: 16px;
}

.time-text {
    font-size: 6rem;
    font-weight: 400;
    color: var(--vp-c-text-1);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    line-height: 1;
}

.date-text {
    font-size: 2rem;
    font-weight: 400;
    color: var(--vp-c-text-2);
    font-variant-numeric: tabular-nums;
    letter-spacing: 8px;
    line-height: 1;
}

/* ── Reveal Button (bouncing icon) ───────────────────────────── */
#reveal-button {
    cursor: pointer;
    font-size: 3rem;
    color: var(--vp-c-brand-1);
    transition: all 0.2s ease;
    user-select: none;
}

#reveal-button:hover {
    color: var(--vp-c-brand-2);
    transform: scale(1.1);
}

#reveal-button-wrapper {
    bottom: 0;
    left: 50%;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    transform: translate(-50%, 40px);
    transition: opacity 250ms, transform 250ms, visibility 250ms;
    visibility: hidden;
    z-index: 2;
}

#reveal-button-wrapper #reveal-button:not(:hover) {
    animation: bounce 3s infinite;
    animation-delay: 3s;
}

/* ── Card Wrapper ────────────────────────────────────────────── */
#app-card-wrapper {
    left: 50%;
    opacity: 0;
    pointer-events: none;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -30%) scale(0.8);
    transition: opacity 250ms, transform 250ms, visibility 250ms;
    visibility: hidden;
    z-index: 2;
}

/* ── Landing Card ────────────────────────────────────────────── */
.landing-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    padding: 35px;
    background: var(--vp-c-bg);
    border: 1px solid var(--vp-c-divider);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

html.dark .landing-card {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.24);
}

/* Logo */
.landing-logo {
    text-align: center;
}

.landing-logo .material-symbols-outlined {
    font-size: 25px;
    color: var(--vp-c-brand-1);
}

/* Header */
.landing-header {
    text-align: center;
}

.landing-header h1 {
    font-size: 1.69rem;
    font-weight: 600;
    color: var(--vp-c-text-1);
    margin: 0 0 8px 0;
}

.landing-header p {
    font-size: 0.95rem;
    color: var(--vp-c-text-2);
    margin: 0;
    line-height: 1.5;
}

/* Features */
.landing-features {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--vp-c-bg-soft);
    border: 1px solid var(--vp-c-divider);
    transition: background 0.2s ease;
}

.feature-item:hover {
    background: var(--vp-c-bg-mute);
}

.feature-item .material-symbols-outlined {
    font-size: 20px;
    color: var(--vp-c-brand-1);
    flex-shrink: 0;
}

.feature-item span:last-child {
    font-size: 0.9rem;
    color: var(--vp-c-text-1);
    line-height: 1.4;
}

/* Actions */
.landing-actions {
    width: 100%;
    display: flex;
    gap: 12px;
    margin-top: 4px;
}

.btn-launch {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 19px;
    min-height: 44px;
    background: var(--vp-c-brand-1);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    font-family: var(--vp-font-family-base);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    text-align: center;
}

.btn-launch:hover {
    background: var(--vp-c-brand-2);
}

.btn-back {
    flex: 1;
    padding: 12px 19px;
    min-height: 44px;
    background: transparent;
    color: var(--vp-c-text-1);
    border: 1px solid var(--vp-c-divider);
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    font-family: var(--vp-font-family-base);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    border-color: var(--vp-c-text-2);
    background: var(--vp-c-bg-soft);
}

/* ── Theme Toggle (Top Right) ────────────────────────────────── */
.theme-toggle-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
}

.theme-toggle-btn:hover {
    transform: scale(1.1);
}

.theme-toggle-btn .material-symbols-outlined {
    font-size: 25px;
    color: var(--vp-c-text-2);
    transition: all 0.2s ease;
}

.theme-toggle-btn:hover .material-symbols-outlined {
    color: var(--vp-c-brand-1);
}

/* ── Responsive ──────────────────────────────────────────────── */
@media (max-width: 1300px) {
    #app-landing.idle #reveal-button-wrapper {
        transform: translate(-40px, 0px);
    }

    #reveal-button-wrapper {
        bottom: 40px;
        left: auto;
        right: 0;
        transform: translate(40px, 0px);
    }
}

@media (max-width: 960px) {
    .time-text {
        font-size: 5rem;
    }

    .date-text {
        font-size: 1.25rem;
        letter-spacing: 6px;
    }

    .landing-card {
        max-width: 400px;
        padding: 27px 19px;
    }
}

@media (max-width: 600px) {
    #reveal-button-wrapper {
        bottom: auto;
        left: 50%;
        right: auto;
        top: 50%;
        transform: translate(-50%, -50%);
    }

    #app-landing.idle #reveal-button-wrapper {
        transform: translate(-50%, -50%);
    }

    #app-info {
        margin: 20px;
    }

    #app-landing.idle #app-info,
    #app-landing.revealed #app-info {
        margin-left: 20px;
    }

    .time-text {
        font-size: 4rem;
    }

    .date-text {
        font-size: 1.125rem;
        letter-spacing: 6px;
    }

    #reveal-button {
        font-size: 3rem;
    }

    .landing-card {
        max-width: 340px;
        padding: 23px 15px;
    }

    .landing-header h1 {
        font-size: 1.44rem;
    }

    .landing-actions {
        flex-direction: column;
    }

    .theme-toggle-btn {
        top: 16px;
        right: 16px;
    }
}

@media (max-width: 400px) {
    .time-text {
        font-size: 3rem;
    }

    .date-text {
        font-size: 1rem;
        letter-spacing: 6px;
    }
}

@media (max-width: 375px) {
    .time-text {
        font-size: 2.5rem;
    }

    .date-text {
        font-size: 0.95rem;
        letter-spacing: 4px;
    }

    .landing-card {
        max-width: calc(100vw - 32px);
    }
}

/* ── Reduced Motion ──────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    #reveal-button-wrapper #reveal-button:not(:hover) {
        animation: none;
    }

    #app-card-wrapper,
    #app-info,
    #reveal-button-wrapper,
    #app-background {
        transition-duration: 0.01ms !important;
    }
}
