@font-face {
    font-family: 'FK Grotesk';
    src: url('assets/fonts/FKGrotesk-Regular.woff2') format('woff2'),
         url('assets/fonts/FKGrotesk-Regular.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

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

body {
    font-family: 'FK Grotesk', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #F2E8D0;
    min-height: 100vh;
    background: #0F0F0F;
}

.bg-video {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: -1;
    animation: bgFadeIn 2.6s ease-out forwards;
}

.bg-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background: linear-gradient(to bottom left, transparent 0%, black 65%);
    animation: overlayFade 3.1s ease-out forwards;
    pointer-events: none;
}

@keyframes bgFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes overlayFade {
    0%   { opacity: 1; }
    20%  { opacity: 1; }
    100% { opacity: 0; }
}

@keyframes textFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 64px;
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    z-index: 1;
}

h1 {
    color: #F2E8D0;
    font-size: 60px;
    font-weight: 400;
    line-height: normal;
    letter-spacing: -2.4px;
    margin-bottom: 2px;
    opacity: 0;
    animation: textFadeIn 1s ease-out 1.6s forwards;
}

.menubar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 6px 16px;
    z-index: 11;
    opacity: 0;
    transform: translateY(-8px);
    animation: menubarFadeIn 0.8s ease-out 0.3s forwards;
}

@keyframes menubarFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.menubar-right {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0;
}

.menubar > svg {
    filter: drop-shadow(0 1px 3px rgba(200, 200, 200, 0.3));
}

.menubar-icon-btn {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 22px;
    border-radius: 20px;
    transition: background 0.15s ease;
    cursor: default;
    flex-shrink: 0;
}

.menubar-icon-btn:hover,
.menubar-icon-btn.hovered {
    background: rgba(0, 0, 0, 0.30);
    background: color(display-p3 0 0 0 / 0.30);
}

.icon-inner {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    -webkit-mask-image: url('assets/menu-bar-icon.svg');
    mask-image: url('assets/menu-bar-icon.svg');
    mask-size: 18px 18px;
    mask-repeat: no-repeat;
    mask-position: center;
}

@keyframes shimmerUp {
    0%   { transform: translateY(100%); opacity: 0; }
    20%  { opacity: 1; }
    80%  { opacity: 1; }
    100% { transform: translateY(-200%); opacity: 0; }
}

.menubar-icon-btn:hover .icon-inner::after,
.menubar-icon-btn.hovered .icon-inner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, transparent 0%, rgba(255, 210, 60, 0.9) 50%, transparent 100%);
    animation: shimmerUp 0.9s ease-in-out forwards;
    pointer-events: none;
}

.menubar-clock-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 22px;
    padding: 0 6px;
    border-radius: 20px;
    transition: background 0.15s ease;
    cursor: default;
}

.menubar-right svg {
    display: block;
    flex-shrink: 0;
}

.menubar span, .menubar-clock-btn {
    color: #FFF;
    color: color(display-p3 1 1 1);
    text-align: center;
    text-shadow: 0 1px 3px rgba(200, 200, 200, 0.3);
    text-shadow: 0 1px 3px color(display-p3 0.8 0.8 0.8 / 0.3);
    font-family: "SF Pro", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-style: normal;
    font-weight: 590;
    line-height: 16px;
}

.hero-row {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
}

.download-btn {
    opacity: 0;
    animation: textFadeIn 1s ease-out 2.1s forwards;
    display: inline-flex;
    align-items: center;
    height: 40px;
    padding: 0 20px;
    background: #F2E8D0;
    color: #1D2629;
    font-family: "SF Pro", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 13px;
    font-weight: 480;
    border-radius: 8px;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Demo cursor */
.demo-cursor {
    position: fixed;
    pointer-events: none;
    z-index: 200;
    opacity: 0;
    will-change: left, top, opacity;
}

@keyframes cursorClick {
    0%   { transform: scale(1); }
    40%  { transform: scale(0.8); }
    100% { transform: scale(1); }
}

.demo-cursor.clicking {
    animation: cursorClick 0.2s ease forwards;
}

/* App popup */
.app-popup {
    position: fixed;
    width: 480px;
    max-width: calc(100vw - 16px);
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow:
        0 0 0 1px rgba(0, 0, 0, 0.55),
        0 8px 40px 0 rgba(0, 0, 0, 0.42),
        inset 0 0 3px 1px rgba(255, 255, 255, 0.12),
        inset 0 1px 0 0 rgba(255, 255, 255, 0.12);
    z-index: 100;
    opacity: 0;
    transform: scale(0.88);
    transform-origin: top;
    pointer-events: none;
    overflow: hidden;
}

@keyframes popupIn {
    from { opacity: 0; transform: scale(0.88); }
    to   { opacity: 1; transform: scale(1); }
}

.app-popup.visible {
    animation: popupIn 0.4s cubic-bezier(0.34, 1.2, 0.64, 1) forwards;
}

.app-popup-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    padding: 0 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    flex-shrink: 0;
}

.app-popup-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.app-popup-title {
    font-family: "SF Pro", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 590;
    color: white;
    line-height: 16px;
}

.app-popup-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 20px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    font-family: "SF Pro", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 440;
    color: rgba(255, 255, 255, 0.7);
    line-height: 16px;
}

.app-popup-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.view-toggle {
    display: flex;
    width: 83px;
    height: 24px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.04);
    overflow: hidden;
}

.toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    background: none;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    padding: 0 8px;
}

.toggle-btn--active {
    background: linear-gradient(to bottom, #353636, #282929);
    box-shadow: 0 0 0 1px rgba(13, 13, 13, 0.5), inset 0 1px 0 0 rgba(255, 255, 255, 0.05);
}

.settings-icon {
    width: 16px;
    height: 16px;
    opacity: 0.6;
    display: block;
    flex-shrink: 0;
}

.app-popup-cameras {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
}

.camera-row {
    display: flex;
    gap: 16px;
}

.camera-tile {
    flex: 1;
    height: 120px;
    border-radius: 8px;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.camera-tile img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.camera-label {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(15, 15, 15, 0.8);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: "SF Pro", -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 12px;
    font-weight: 440;
    color: white;
    line-height: 16px;
    white-space: nowrap;
}

.camera-tile--empty {
    opacity: 0;
}

.camera-expanded {
    display: none;
    position: relative;
    margin: 0;
    border-radius: 0;
    overflow: hidden;
    height: 256px;
    opacity: 0;
}

.camera-expanded img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

@keyframes expandedFadeIn {
    from { opacity: 0; transform: scale(0.96); }
    to   { opacity: 1; transform: scale(1); }
}

@keyframes expandedFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

.camera-expanded.visible {
    display: block;
    animation: expandedFadeIn 0.4s cubic-bezier(0.34, 1.1, 0.64, 1) forwards;
}

.camera-expanded.hiding {
    display: block;
    animation: expandedFadeOut 0.3s ease forwards;
}

@keyframes popupOut {
    from { opacity: 1; transform: scale(1); }
    to   { opacity: 0; transform: scale(0.92); }
}

.app-popup.hiding {
    animation: popupOut 0.3s ease forwards;
}

p {
    opacity: 0;
    animation: textFadeIn 1s ease-out 1.9s forwards;
    color: #F2E8D0;
    font-feature-settings: 'ss01' on, 'ss03' on, 'ss04' on;
    font-size: 24px;
    font-weight: 400;
    line-height: normal;
    letter-spacing: -0.48px;
    max-width: 600px;
}

/* Tablet: hide nestle + File, Edit, View, Help */
@media (max-width: 768px) {
    .menubar > span {
        display: none;
    }
}

/* Stack hero at 640px */
@media (max-width: 640px) {
    .hero-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .download-btn {
        margin-top: 24px;
    }

    .container {
        padding: 40px;
    }
}

/* Mobile: minimal menu bar */
@media (max-width: 480px) {
    .menubar > span {
        display: none;
    }

    .menubar-right .menubar-icon-btn:not(#menubarIconBtn) {
        display: none;
    }
}
