/* Reset and base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #0a0a0a;
    color: #e0e0e0;
    line-height: 1.6;
    min-height: 100vh;
}

/* Main container */
main {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Intro section */
.intro {
    text-align: center;
    padding: 3rem 1rem;
    border-bottom: 1px solid #2a2a2a;
    margin-bottom: 2rem;
}

.intro h1 {
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: #ffffff;
    margin-bottom: 1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
}

.intro p {
    font-size: clamp(1rem, 3vw, 1.125rem);
    color: #a0a0a0;
    max-width: 600px;
    margin: 0 auto;
}

/* Timeline / frames */
.timeline {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.frame {
    scroll-margin-top: 1rem;
}

.frame figure {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.frame img,
.frame video {
    width: 100%;
    height: auto;
    border-radius: 4px;
    border: 1px solid #2a2a2a;
    background-color: #1a1a1a;
    /* Placeholder min-height for missing images */
    min-height: 200px;
    object-fit: contain;
}

.frame figcaption {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0 0.5rem;
}

.timestamp {
    font-size: 0.875rem;
    color: #666;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    letter-spacing: 0.05em;
}

.caption {
    font-size: clamp(1rem, 3vw, 1.125rem);
    color: #e0e0e0;
}

.attribution {
    font-size: 0.875rem;
    color: #888;
    font-style: italic;
    margin-top: 0.25rem;
}

/* Text-only frame */
.frame-text .text-block {
    background-color: #111;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    padding: 2.5rem 2rem;
    text-align: center;
}

.frame-text .text-block p {
    font-size: clamp(1.1rem, 3.5vw, 1.35rem);
    color: #e0e0e0;
    margin-bottom: 1rem;
    line-height: 1.7;
}

.frame-text .text-block p:last-child {
    margin-bottom: 0;
    color: #fff;
    font-weight: 500;
}

/* Amendments block */
.amendments-block {
    background-color: #111;
    border: 1px solid #2a2a2a;
    border-radius: 4px;
    padding: 2rem 1.5rem;
    text-align: left;
}

.amendment {
    font-size: clamp(1rem, 3vw, 1.2rem);
    color: #888;
    margin-bottom: 1.25rem;
    line-height: 1.5;
    display: flex;
    align-items: baseline;
    gap: 1rem;
}

.amendment:last-child {
    margin-bottom: 0;
}

.amendment .numeral {
    font-weight: 600;
    color: #666;
    min-width: 2rem;
    font-family: "Times New Roman", Georgia, serif;
}

.amendment.struck {
    text-decoration: line-through;
    text-decoration-color: #8b0000;
    text-decoration-thickness: 2px;
}

/* Closing section */
.closing {
    margin-top: 4rem;
    padding-top: 2rem;
    border-top: 1px solid #2a2a2a;
}

.closing h2 {
    font-size: 1.25rem;
    color: #ffffff;
    margin-bottom: 1rem;
    font-weight: 400;
}

.closing p {
    color: #a0a0a0;
    margin-bottom: 1rem;
}

.closing ul {
    list-style: none;
    margin-bottom: 2rem;
}

.closing li {
    margin-bottom: 0.75rem;
}

.closing a {
    color: #6a9fb5;
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.2s;
}

.closing a:hover,
.closing a:focus {
    border-bottom-color: #6a9fb5;
}

.fact {
    font-size: 1.125rem;
    color: #ffffff;
    padding: 1.5rem;
    background-color: #1a1a1a;
    border-left: 3px solid #4a4a4a;
    margin-top: 2rem;
}

/* Frame indicator (desktop) */
.frame-indicator {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    background-color: rgba(20, 20, 20, 0.9);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
    font-size: 0.875rem;
    color: #666;
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
}

.frame-indicator.visible {
    opacity: 1;
}

/* Hide indicator on mobile - scroll is obvious */
@media (max-width: 768px) {
    .frame-indicator {
        display: none;
    }

    main {
        padding: 1.5rem 1rem;
    }

    .intro {
        padding: 2rem 0.5rem;
    }

    .timeline {
        gap: 2.5rem;
    }
}

/* Focus styles for accessibility */
a:focus {
    outline: 2px solid #6a9fb5;
    outline-offset: 2px;
}

/* Keyboard navigation hint (shown briefly on desktop) */
@media (min-width: 769px) {
    body::after {
        content: "Use \2190 \2192 arrow keys to navigate";
        position: fixed;
        bottom: 1.5rem;
        left: 1.5rem;
        background-color: rgba(20, 20, 20, 0.9);
        padding: 0.5rem 1rem;
        border-radius: 4px;
        font-size: 0.75rem;
        color: #666;
        opacity: 0;
        animation: fadeHint 4s ease-out forwards;
        pointer-events: none;
    }
}

@keyframes fadeHint {
    0% { opacity: 0; }
    10% { opacity: 1; }
    70% { opacity: 1; }
    100% { opacity: 0; }
}
