/* Base Styles */
:root {
    /* Color palette from AL-60 design */
    --base-off-white: #F3F0EA;
    --dial-gray: #F9F7F3;
    --accent-gray: #A8A6A1;
    --knob-gray: #D6D4D0;
    --tick-mark-gray: #999999;
    --alarm-red: #D7442E;
    --highlight-beige: #E7E3DD;
}

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

html, body {
    height: 100%;
    font-family: 'Space Grotesk', sans-serif;
    background-color: var(--base-off-white);
    color: #333;
    line-height: 1.6;
}

body {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 5vh 5vw;
    min-height: 100vh;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    gap: 10vh;
}

/* Typography */
h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 400;
    text-align: center;
    max-width: 18ch;
    margin-bottom: 2rem;
    letter-spacing: -0.02em;
}

.subline {
    font-size: clamp(1.25rem, 2vw, 1.75rem);
    text-align: center;
    max-width: 40ch;
    color: var(--accent-gray);
    font-weight: 300;
}

/* Sections */
section {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.opening {
    margin-top: 5vh;
}

/* Product Visual */
.product-visual {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
}

.image-container {
    width: 100%;
    max-width: 500px;
    aspect-ratio: 1;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Popover Container */
.popover-container {
    background-color: var(--base-off-white);
    padding: 20px; /* Add some padding around the app preview */
    border-radius: 10px; /* Match AppDelegate */
    border: 1px solid var(--alarm-red); /* Match AppDelegate */
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    display: inline-block; /* Fit content */
    position: relative; /* For corner pseudo-elements */
}

/* Red dot in top-right corner of popover */
.popover-container::after {
    content: '';
    position: absolute;
    top: 10px;
    right: 10px;
    width: 14px;
    height: 14px;
    background-color: var(--alarm-red);
    border-radius: 50%;
    z-index: 10; /* Ensure dot is above app-preview */
    pointer-events: none;
}

/* App name in bottom-right corner of popover */
.popover-container::before {
    content: 'AL-60';
    position: absolute;
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    font-weight: 300;
    color: var(--tick-mark-gray);
    z-index: 10; /* Ensure label is above app-preview */
    pointer-events: none;
}

/* App Preview Styling */
.app-preview {
    width: 360px;
    height: 360px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: var(--base-off-white);
    border-radius: 0;
    box-shadow: none;
    border: none;
    padding: 0;
    position: relative;
    z-index: 2; /* Ensure knob is above the arc */
    margin: 0 auto;
}

/* Main timer circle */
.timer-circle {
    position: relative;
    width: 250px;
    height: 250px;
    border-radius: 50%;
    background-color: var(--dial-gray);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: center;
    align-items: center;
    border: 0.5px solid var(--accent-gray);
    z-index: 0; /* Dial is at the bottom */
}

/* Tick marks */
.timer-dial {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    pointer-events: none;
    z-index: 1; /* Above dial, below arc path */
}

/* Minute numbers */
.minute-numbers {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: 1; /* Above dial, below arc path */
}

.minute-number {
    position: absolute;
    font-size: 12px;
    color: var(--tick-mark-gray);
    font-weight: 500;
    width: 20px;
    height: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    transform-origin: center center;
    transform: translate(-50%, -50%);
}

.minute-0 { top: calc(50% - 125px - 18px); left: 50%; }
.minute-5 { top: calc(50% - 125px * 0.866 - 18px * 0.866); left: calc(50% + 125px * 0.5 + 18px * 0.5); }
.minute-10 { top: calc(50% - 125px * 0.5 - 18px * 0.5); left: calc(50% + 125px * 0.866 + 18px * 0.866); }
.minute-15 { top: 50%; left: calc(50% + 125px + 18px); }
.minute-20 { top: calc(50% + 125px * 0.5 + 18px * 0.5); left: calc(50% + 125px * 0.866 + 18px * 0.866); }
.minute-25 { top: calc(50% + 125px * 0.866 + 18px * 0.866); left: calc(50% + 125px * 0.5 + 18px * 0.5); }
.minute-30 { top: calc(50% + 125px + 18px); left: 50%; }
.minute-35 { top: calc(50% + 125px * 0.866 + 18px * 0.866); left: calc(50% - 125px * 0.5 - 18px * 0.5); }
.minute-40 { top: calc(50% + 125px * 0.5 + 18px * 0.5); left: calc(50% - 125px * 0.866 - 18px * 0.866); }
.minute-45 { top: 50%; left: calc(50% - 125px - 18px); }
.minute-50 { top: calc(50% - 125px * 0.5 - 18px * 0.5); left: calc(50% - 125px * 0.866 - 18px * 0.866); }
.minute-55 { top: calc(50% - 125px * 0.866 - 18px * 0.866); left: calc(50% - 125px * 0.5 - 18px * 0.5); }

/* Tick marks - major and minor */
.tick-marks {
    position: absolute;
    top: 10px; /* Shift down to recenter pivot */
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    z-index: 1; /* Above dial, below arc path */
}

/* Tick marks */
.tick {
    position: absolute;
    top: 0;
    left: 50%;
    /* Set origin even closer to the center (115px down instead of 120px) */
    transform-origin: center 115px; /* Adjusted origin */
    background-color: var(--tick-mark-gray);
    border-radius: 1px; /* Slightly rounded ends */
    /* Position horizontally, then apply rotation */
    transform: translateX(-50%) rotate(var(--angle));
    /* Define width/height vars */
    --tick-width: 1px; /* Default */
    --tick-height: 5px; /* Default */
    width: var(--tick-width);
    height: var(--tick-height);
}

.tick-minor {
    --tick-width: 1px;
    --tick-height: 5px;
}

.tick-major {
    --tick-width: 2px;
    --tick-height: 8px;
}

/* Progress Arc (SVG Path) */
.progress-arc-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none; /* Allow clicks through */
    z-index: 2; /* Above ticks, below knob */
}

.progress-arc-path {
    fill: var(--alarm-red);
    stroke: none;
}

/* Central Knob */
.timer-knob {
    width: 80px;
    height: 80px;
    background-color: var(--knob-gray);
    border-radius: 50%;
    /* Changed to outer drop shadow for raised effect */
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15), 0 1px 2px rgba(255,255,255,0.3);
    border: 0.5px solid var(--accent-gray);
    position: relative; /* Keep relative for inner elements */
    z-index: 3; /* Above arc path and ticks */
}

/* Indicator dot on knob */
.timer-knob::before {
    content: '';
    position: absolute;
    top: 50%; /* Center vertically */
    right: 10px; /* Position near right edge (15 minutes) */
    transform: translateY(-50%);
    width: 6px;
    height: 6px;
    background-color: var(--accent-gray); /* Use accent color for dot */
    border-radius: 50%;
    box-shadow: inset 0 0.5px 1px rgba(0,0,0,0.2);
}

/* Notify Section */
.notify {
    margin-top: 2vh;
    text-align: center;
}

.notify .primary {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 400;
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.notify .secondary {
    font-size: clamp(1rem, 3vw, 1.25rem);
    font-weight: 300;
    color: var(--accent-gray);
    margin-bottom: 0;
}

form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    max-width: 400px;
}

input {
    padding: 1rem;
    border: 1px solid var(--accent-gray);
    background-color: var(--dial-gray);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
}

button {
    padding: 1rem;
    background-color: var(--highlight-beige);
    border: 1px solid var(--accent-gray);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

button:hover {
    background-color: var(--knob-gray);
}

/* Brand link override */
.brand-link {
    color: inherit; /* use surrounding text color */
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid var(--accent-gray);
    padding-bottom: 2px;
}
.brand-link:hover {
    color: var(--accent-gray);
    opacity: 0.8;
}

/* Footer */
footer {
    text-align: center;
    margin-top: auto; /* Push footer to bottom */
    padding-top: 4rem; /* Add space above footer */
    font-size: 0.9rem;
    color: var(--accent-gray);
}

footer p {
    margin-bottom: 0.5rem;
}

footer a {
    color: var(--accent-gray); /* Use accent color for links */
    text-decoration: none; /* Remove default underline */
    transition: color 0.2s ease;
}

footer a:hover {
    color: #333; /* Darken link on hover */
    text-decoration: underline; /* Add underline on hover */
}

.links {
    display: flex;
    gap: 1.5rem;
}

.links a {
    color: var(--accent-gray);
    text-decoration: none;
}

.links a:hover {
    text-decoration: underline;
}

/* Journey Section */
#journey {
    background-color: var(--base-off-white);
    padding: 5rem 1rem;
}
#journey .journey-container {
    max-width: 700px;
    margin: 0 auto;
}
#journey .entry {
    margin-bottom: 4rem;
}
#journey h2 {
    font-size: 1.75rem;
    font-weight: 400;
    text-align: center;
    color: #333;
    margin-bottom: 3rem;
}
#journey .entry-date {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.875rem;
    color: var(--accent-gray);
    margin-bottom: 0.5rem;
}
#journey .entry-text {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    color: #333;
    line-height: 1.6;
    margin: 0.25rem 0;
}
#journey .final-line {
    font-family: 'Space Grotesk', sans-serif;
    font-weight: 300;
    font-size: 1rem;
    color: #333;
    text-align: center;
    margin-top: 3rem;
}

/* Wishlist (email list) */
.wishlist-section {
    width: 100%;
    max-width: 500px;
    margin: 5vh auto;
    text-align: center;
}
.wishlist-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
}
.wishlist-form {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
}
.wishlist-form input[type="email"] {
    flex: 1 1 200px;
    padding: 0.5rem 1rem;
    border: 1px solid var(--accent-gray);
    border-radius: 4px;
    font-size: 1rem;
}
.wishlist-form button {
    padding: 0.75rem 1.5rem;
    background-color: var(--alarm-red);
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
}
.wishlist-form button:hover {
    background-color: #b12f27;
}
.form-message {
    width: 100%;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}
.form-message.success {
    color: green;
}
.form-message.error {
    color: red;
}

/* Content Pages (Support, Privacy, Terms) */
.content-page {
    max-width: 800px; /* Limit width for readability */
    width: 90%;
    margin: 5vh auto; /* Center and add vertical margin */
    padding: 2rem;
    text-align: left; /* Align text left for readability */
    background-color: var(--base-off-white); /* Ensure background consistency */
    border-radius: 8px; /* Optional: subtle rounding */
    box-shadow: 0 2px 8px rgba(0,0,0,0.05); /* Optional: subtle shadow */
}

.content-page h1 {
    text-align: left;
    margin-bottom: 1.5rem;
}

.content-page h2 {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 500;
}

.content-page p {
    margin-bottom: 1rem;
}

.content-page a.brand-link {
    display: inline-block; /* Keep it inline */
    margin-top: 2rem; /* Add space before back link */
}

/* Product Visual */
.product-visual {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: auto;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    footer {
        padding-top: 2rem;
        font-size: 0.8rem;
    }
    footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    form {
        width: 90%;
    }
}

@media (max-width: 480px) {
    body {
        padding: 2vh 5vw;
    }
}

/* Coming Soon button */
.coming-soon-btn {
    position: fixed;
    top: 20px;
    right: 20px;
}
