@font-face {
    font-family: 'Akriti';
    src: url('akriti.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

:root {
    --primary-color: #414141;
    --secondary-color: #444444;
    --accent-color-1: #FF6B6B;  /* Hint of red */
    --accent-color-2: #4ECDC4;  /* Hint of teal */
    --accent-color-3: #FFE66D;  /* Hint of yellow */
    --text-color: #333333;
    --light-color: #fff;
    --bg-color: #f8f8f8;
    --sketch-dark: #222222;
    --timer-bg: rgba(240, 240, 240, 0.5);
}

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

body {
    font-family: 'Lato', sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    /* Canvas-like texture with noise and subtle grain */
    background-image: 
        url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)' opacity='0.15'/%3E%3C/svg%3E");
    background-attachment: fixed;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
    z-index: 1;
    position: relative;
}

/* Header and Profile */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 3rem;
    text-align: center;
}

.profile-container {
    margin-bottom: 2rem;
}

.profile-frame {
    width: 220px;
    height: 220px;
    padding: 10px;
    background: var(--light-color);
    position: relative;
    z-index: 1;
    transition: all 0.3s ease;
}

.profile-frame::before {
    content: '';
    position: absolute;
    top: -5px;
    left: -5px;
    right: -5px;
    bottom: -5px;
    border: 2px solid var(--primary-color);
    z-index: -1;
    transform: rotate(-1deg);
    /* Sketchy border effect */
    filter: url('#sketchy-filter');
}

.profile-frame::after {
    content: '';
    position: absolute;
    top: -10px;
    left: -10px;
    right: -10px;
    bottom: -10px;
    border: 1px solid var(--accent-color-1);
    z-index: -2;
    transform: rotate(1deg);
}

.profile-frame:hover {
    transform: scale(1.03);
}

/* Add doodle elements around the profile */
.profile-container {
    position: relative;
}

.profile-container::before {
    content: '✨';
    position: absolute;
    top: -15px;
    right: 20px;
    font-size: 20px;
    transform: rotate(20deg);
    color: var(--accent-color-1);
}

.profile-container::after {
    content: '✎';
    position: absolute;
    bottom: 0;
    left: -15px;
    font-size: 24px;
    transform: rotate(-15deg);
    color: var(--accent-color-2);
}

#profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 5px;
    filter: contrast(1.1);
}

.about-text {
    max-width: 700px;
}

h1 {
    font-family: 'Caveat', cursive;
    font-size: 3.2rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    letter-spacing: 1px;
}

h1::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-color-3);
    opacity: 0.6;
}

.poster-text {
    display: flex;
    flex-direction: column;
    margin-bottom: 2rem;
    max-width: 600px;
}

.poster-text .line {
    font-family: 'Akriti', sans-serif;
    font-size: 1.3rem; /* Slightly bigger */
    line-height: 1.6;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.poster-text .bold {
    color: #343434
}

/* Mode Toggle */
.mode-toggle-section {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.toggle-container {
    display: flex;
    align-items: center;
    background-color: var(--light-color);
    padding: 0.7rem 1.8rem;
    border: 2px solid var(--text-color);
    box-shadow: 5px 5px 0 rgba(41, 47, 54, 0.2);
    transform: rotate(-1deg);
    transition: all 0.3s ease;
}

.toggle-container:hover {
    transform: rotate(1deg) translateY(-2px);
    box-shadow: 7px 7px 0 rgba(41, 47, 54, 0.2);
}

.toggle-label {
    font-family: 'Caveat', cursive;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin: 0 0.5rem;
}

.switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--accent-color);
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: var(--secondary-color);
    transition: .4s;
}

input:checked + .slider {
    background-color: var(--primary-color);
}

input:checked + .slider:before {
    transform: translateX(26px);
    background-color: var(--light-color);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Countdown Section */
.countdown-section {
    background-color: var(--light-color);
    padding: 2rem;
    text-align: center;
    position: relative;
    z-index: 2;
    margin-bottom: 3rem;
    overflow: visible;
    border: 2px solid var(--primary-color);
    position: relative;
}

/* Sketchy border around countdown section */
.countdown-section::before {
    content: '';
    position: absolute;
    top: -8px;
    left: -8px;
    right: -8px;
    bottom: -8px;
    border: 1px dashed var(--secondary-color);
    z-index: -1;
}

/* Hand-drawn stars around the countdown */
.countdown-section::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-image: 
        radial-gradient(circle at 90% 10%, var(--accent-color-1) 0%, var(--accent-color-1) 1px, transparent 1px),
        radial-gradient(circle at 10% 90%, var(--accent-color-2) 0%, var(--accent-color-2) 1px, transparent 1px),
        radial-gradient(circle at 85% 83%, var(--accent-color-3) 0%, var(--accent-color-3) 1px, transparent 1px),
        radial-gradient(circle at 23% 25%, var(--accent-color-1) 0%, var(--accent-color-1) 1px, transparent 1px),
        radial-gradient(circle at 40% 95%, var(--accent-color-2) 0%, var(--accent-color-2) 1px, transparent 1px),
        radial-gradient(circle at 95% 40%, var(--accent-color-3) 0%, var(--accent-color-3) 1px, transparent 1px);
    background-size: 200px 200px;
    background-repeat: no-repeat;
    z-index: -1;
    opacity: 0.8;
}

/* Notebook-style background */
.countdown-section > * {
    position: relative;
    z-index: 2;
}

.countdown-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 30px;
    height: 100%;
    width: 2px;
    background-color: rgba(0,0,0,0.1);
    z-index: 1;
}

/* Doodle elements around countdown */
.countdown-section .doodle-element {
    position: absolute;
    font-size: 24px;
    color: var(--secondary-color);
    opacity: 0.4;
}

.countdown-section .doodle-1 {
    top: -15px;
    right: 30px;
    transform: rotate(20deg);
}

.countdown-section .doodle-2 {
    bottom: -10px;
    left: 40px;
    transform: rotate(-15deg);
}

@keyframes twinkle {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

#countdown-title {
    font-family: 'Caveat', cursive;
    font-size: 2.4rem;
    font-weight: 700;
    margin-bottom: 2rem;
    color: var(--primary-color);
    position: relative;
    display: inline-block;
    letter-spacing: 1px;
}

.countdown-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.countdown-item {
    background-color: var(--light-color);
    padding: 1rem;
    min-width: 100px;
    display: flex;
    flex-direction: column;
    transition: all 0.3s ease;
    position: relative;
    border: 2px solid var(--primary-color);
    transform: rotate(var(--rotation));
    --rotation: 0deg;
    filter: url('#sketchy-filter');
}

/* Rough sketch line around items */
.countdown-item::after {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    border: 1px solid var(--accent-color-1);
    z-index: -1;
    transform: rotate(-1deg);
}

.countdown-item:nth-child(1)::after { border-color: var(--accent-color-1); }
.countdown-item:nth-child(2)::after { border-color: var(--accent-color-2); }
.countdown-item:nth-child(3)::after { border-color: var(--accent-color-3); }
.countdown-item:nth-child(4)::after { border-color: var(--accent-color-2); }
.countdown-item:nth-child(5)::after { border-color: var(--accent-color-1); }
.countdown-item:nth-child(6)::after { border-color: var(--accent-color-3); }

.countdown-item:nth-child(odd) {
    --rotation: 2deg;
}

.countdown-item:nth-child(even) {
    --rotation: -2deg;
}

.countdown-item:hover {
    transform: translateY(-8px) rotate(var(--rotation));
}

.countdown-item span:first-child {
    font-family: 'Caveat', cursive;
    font-size: 2.8rem;
    font-weight: 700;
    color: var(--primary-color);
    line-height: 1;
}

/* Special style for days in AK mode */
.countdown-item:nth-child(2) span:first-child {
    font-size: 3.2rem;
}

.countdown-item .label {
    font-family: 'Akriti', sans-serif;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-color);
    opacity: 0.7;
    margin-top: 0.5rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 0;
    color: var(--secondary-color);
    font-size: 0.9rem;
    font-family: 'Akriti', sans-serif;
}

/* Sketchy Elements */
.sketch-elements {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.sketch-element {
    position: absolute;
    font-size: 28px;
    opacity: 0.2;
    animation: float 20s infinite ease-in-out;
    filter: grayscale(0.7);
    transition: opacity 0.3s ease;
}

.sketch-element:hover {
    opacity: 0.5;
}

.e1 {
    top: 15%;
    left: 8%;
    transform: rotate(-15deg);
    animation-delay: 0s;
    color: var(--accent-color-1);
}

.e2 {
    top: 65%;
    right: 10%;
    transform: rotate(20deg);
    animation-delay: -4s;
    font-size: 32px;
    color: var(--accent-color-2);
}

.e3 {
    bottom: 25%;
    left: 12%;
    transform: rotate(5deg);
    animation-delay: -8s;
    font-size: 30px;
    color: var(--accent-color-3);
}

.e4 {
    top: 35%;
    right: 18%;
    transform: rotate(-10deg);
    animation-delay: -2s;
    font-size: 26px;
    color: var(--accent-color-1);
}

.e5 {
    bottom: 15%;
    right: 25%;
    transform: rotate(8deg);
    animation-delay: -6s;
    font-size: 28px;
    color: var(--accent-color-2);
}

.e6 {
    top: 50%;
    left: 25%;
    transform: rotate(-5deg);
    animation-delay: -10s;
    font-size: 30px;
    color: var(--accent-color-3);
}

/* Add hand-drawn line elements */
.floating-elements {
    display: none; /* Hide the old floating elements */
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(var(--rotation, 0deg));
    }
    33% {
        transform: translateY(-8px) rotate(calc(var(--rotation, 0deg) + 3deg));
    }
    66% {
        transform: translateY(5px) rotate(calc(var(--rotation, 0deg) - 2deg));
    }
}

/* Media Queries for Responsiveness */
@media (min-width: 768px) {
    header {
        flex-direction: row;
        text-align: left;
        justify-content: center;
        gap: 3rem;
    }
    
    .profile-container {
        margin-bottom: 0;
    }
}

@media (max-width: 767px) {
    h1 {
        font-size: 2.5rem;
    }
    
    #countdown-title {
        font-size: 1.8rem;
    }
    
    .countdown-item {
        min-width: 80px;
        padding: 0.8rem;
    }
    
    .countdown-item span:first-child {
        font-size: 2rem;
    }
    
    /* Responsive adjustments for poster text */
    .poster-text .line {
        font-size: 1.2rem;
        margin-bottom: 0.9rem;
    }
}

@media (max-width: 520px) {
    .container {
        padding: 1rem;
    }
    
    .countdown-item {
        min-width: 70px;
        padding: 0.6rem;
    }
    
    .countdown-item span:first-child {
        font-size: 1.5rem;
    }
    
    .countdown-item .label {
        font-size: 0.7rem;
    }
    
    .toggle-container {
        padding: 0.4rem 1rem;
    }
    
    .toggle-label {
        font-size: 0.8rem;
    }
    
    /* Even smaller screen adjustments for poster text */
    .poster-text .line {
        font-size: 1.1rem;
        margin-bottom: 0.8rem;
    }
}