@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;900&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="white" stroke="black" stroke-width="1"><path d="M13 2L3 14h8l-1 8 10-12h-8l1-8z"/></svg>') 12 12, auto;
}

/* Disable zoom on iOS */
html {
    touch-action: manipulation;
    background: #004148;
}

::selection {
    background: #009DAE;
    color: #fff;
}

::-moz-selection {
    background: #009DAE;
    color: #fff;
}

body {
    font-family: 'Inter', sans-serif;
    background: linear-gradient(to top, #009DAE, #004148);
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
    touch-action: manipulation;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

/* body::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('img/background_edge.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    filter: invert(1) brightness(2);
    mix-blend-mode: overlay;
    pointer-events: none;
    z-index: 0;
    animation: glitch 4s infinite;
} */

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 0, 0, 0.2) 0px,
        rgba(0, 0, 0, 0.2) 1px,
        transparent 1px,
        transparent 2px
    );
    pointer-events: none;
    z-index: 999;
    animation: scanline 8s linear infinite;
}

@keyframes scanline {
    0% {
        transform: translateY(0);
    }
    100% {
        transform: translateY(20px);
    }
}

/* Datamosh Overlay */
.datamosh-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 998;
    pointer-events: none;
    opacity: 0;
    animation: datamosh 4s infinite;
    background:
        linear-gradient(90deg, transparent 0%, rgba(0, 157, 174, 0.3) 25%, transparent 26%, transparent 100%),
        linear-gradient(90deg, transparent 0%, rgba(0, 255, 255, 0.2) 50%, transparent 51%, transparent 100%),
        linear-gradient(0deg, transparent 0%, rgba(255, 255, 255, 0.1) 75%, transparent 76%, transparent 100%);
    background-size: 100% 15%, 100% 8%, 100% 20%;
    background-position: 0% 30%, 0% 60%, 0% 80%;
    background-repeat: no-repeat;
    mix-blend-mode: screen;
}

@keyframes datamosh {
    0%, 95.5%, 100% {
        opacity: 0;
        transform: translateX(0) scaleX(1);
        filter: contrast(1);
    }
    96% {
        opacity: 1;
        transform: translateX(10px) scaleX(1.02);
        filter: contrast(3);
    }
    96.5% {
        opacity: 0.8;
        transform: translateX(-15px) scaleX(0.98);
        filter: contrast(2);
    }
    97% {
        opacity: 1;
        transform: translateX(8px) scaleX(1.01);
        filter: contrast(3);
    }
    97.5% {
        opacity: 0.6;
        transform: translateX(-5px) scaleX(0.99);
        filter: contrast(2);
    }
    98% {
        opacity: 0;
        transform: translateX(0) scaleX(1);
        filter: contrast(1);
    }
}

/* Background Shapes */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    width: 100px;
    height: 30px;
    background: rgba(0, 157, 174, 0.15);
    clip-path: polygon(20% 0%, 100% 0%, 80% 100%, 0% 100%);
    animation: floatAcross linear infinite;
    left: -150px;
    opacity: 0;
}

@keyframes floatAcross {
    0% {
        transform: translateX(-100px);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    100% {
        transform: translateX(calc(100vw + 100px));
        opacity: 0;
    }
}

.container {
    text-align: center;
    padding: 2rem;
    max-width: 900px;
    width: 100%;
    position: relative;
    z-index: 1;
    animation: glitch 4s infinite;
    transform: scale(0.85);
}

@keyframes glitch {
    0%, 96%, 100% {
        transform: scale(0.85) translate(0);
        filter: none;
    }
    96.5% {
        transform: scale(0.85) translate(-5px, 3px) skew(0.5deg);
        filter: drop-shadow(3px 0 0 #009DAE) drop-shadow(-3px 0 0 #00FFFF);
    }
    97% {
        transform: scale(0.85) translate(5px, -3px) skew(-0.5deg);
        filter: drop-shadow(-3px 0 0 #009DAE) drop-shadow(3px 0 0 #00FFFF);
    }
    97.5% {
        transform: scale(0.85) translate(-3px, 5px) skew(0.3deg);
        filter: drop-shadow(3px 0 0 #009DAE) drop-shadow(-3px 0 0 #00FFFF);
    }
    98% {
        transform: scale(0.85) translate(3px, -5px) skew(-0.3deg);
        filter: drop-shadow(-3px 0 0 #009DAE) drop-shadow(3px 0 0 #00FFFF);
    }
    98.5% {
        transform: scale(0.85) translate(0);
        filter: none;
    }
}

/* Logo */
.logo {
    margin-bottom: 6rem;
    position: relative;
    z-index: 1000;
}

.logo img {
    width: 400px;
    height: auto;
    display: block;
    margin: 0 auto;
}

/* Countdown */
.countdown {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 7.5rem;
}

.countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown-value {
    font-size: 4rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 0 0 20px rgba(255, 255, 255, 0.5);
    min-width: 120px;
}

.countdown-label {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.5rem;
}

/* Battery Container */
.battery-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    margin-bottom: 4.5rem;
}

/* Battery */
.battery {
    position: relative;
    width: 400px;
    height: 40px;
    border: 0px;
    clip-path: polygon(5% 0%, 100% 0%, 95% 100%, 0% 100%);
    overflow: hidden;
}

.battery-terminal {
    display: none;
}

.battery-segments {
    display: flex;
    gap: 3px;
    height: 100%;
    padding: 6px;
}

.segment {
    flex: 1;
    background: #005161;
    transition: background-color 0.3s ease;
}

.segment.active {
    background: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
}

.segment.blink {
    animation: segmentBlink 1s ease-in-out infinite;
}

@keyframes segmentBlink {
    0%, 100% {
        background: #ffffff;
        box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    }
    50% {
        background: #005161;
        box-shadow: none;
    }
}

.battery-percentage {
    font-size: 1.5rem;
    font-weight: 600;
    color: #fff;
    letter-spacing: 0.1rem;
    text-shadow: 0 0 10px rgba(0, 157, 174, 0.5);
    display: none;
}

/* Release Date */
.release-date {
    margin-top: 2rem;
    width: 100%;
    max-width: 400px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
}

.release-date p {
    font-size: 1.1rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 0.2rem;
    text-transform: uppercase;
    margin: 0;
    white-space: nowrap;
}

/* Footer */
footer {
    position: fixed;
    bottom: 2rem;
    left: 0;
    right: 0;
    text-align: center;
    z-index: 1;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
}

.social-icons a {
    color: rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="%23009DAE" stroke="white" stroke-width="1"><path d="M13 2L3 14h8l-1 8 10-12h-8l1-8z"/></svg>') 12 12, pointer;
}

.social-icons a:hover {
    color: #005161;
    transform: translateY(-3px);
}

.social-icons svg {
    width: 24px;
    height: 24px;
}

footer p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.6);
    letter-spacing: 0.1rem;
}

footer a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s ease;
}

footer a:hover {
    color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .logo img {
        width: 350px;
    }

    .countdown {
        gap: 1.5rem;
    }

    .countdown-value {
        font-size: 2.5rem;
        min-width: 70px;
    }

    .countdown-label {
        font-size: 0.7rem;
    }

    .battery {
        width: 350px;
        height: 30px;
    }

    .battery-terminal {
        width: 12px;
        height: 15px;
        right: -16px;
    }

    .battery-percentage {
        font-size: 1.2rem;
    }

    .release-date {
        width: 100%;
        max-width: 350px;
        margin: 2rem auto 0 auto;
        display: flex;
        justify-content: center;
    }

    .battery-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .logo img {
        width: 290px;
    }

    .countdown {
        gap: 1rem;
        flex-wrap: wrap;
    }

    .countdown-value {
        font-size: 2rem;
        min-width: 60px;
    }

    .battery {
        width: 290px;
        height: 25px;
    }

    .release-date {
        width: 100%;
        max-width: 290px;
        margin: 2rem auto 0 auto;
        display: flex;
        justify-content: center;
    }

    .battery-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .battery {
        margin: 0 auto;
    }
}

/* Landscape Block Overlay */
.landscape-block {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to top, #009DAE, #004148);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.landscape-message {
    text-align: center;
    color: #fff;
    animation: pulse 2s ease-in-out infinite;
}

.landscape-message svg {
    margin-bottom: 1.5rem;
    animation: rotate-phone 1.5s ease-in-out infinite;
}

@keyframes rotate-phone {
    0%, 100% {
        transform: rotate(0deg);
    }
    50% {
        transform: rotate(-90deg);
    }
}

.landscape-message p {
    font-size: 1.2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

/* Show landscape block only on mobile in landscape orientation */
@media screen and (max-width: 900px) and (orientation: landscape) {
    .landscape-block {
        display: flex;
    }
}
