@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,400&family=Inter:wght@400;500;600&display=swap');

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

html {
    font-size: 16px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: #fafafa;
    color: #1a1a1a;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

main {
    width: 100%;
    max-width: 900px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
}

/* Header */
header {
    text-align: center;
}

h1 {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 3.5rem;
    font-weight: 300;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 1.125rem;
    font-style: italic;
    color: #666;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* Visualization container - BIG on desktop */
.visualization {
    position: relative;
    width: 100%;
    max-width: 550px;
    aspect-ratio: 1;
}

/* SVG Ring */
.cycle-ring {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.label-overlay {
    position: absolute;
    display: block;
    background: transparent;
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
    pointer-events: auto;
    z-index: 4;
    outline: none;
    box-shadow: none;
    appearance: none;
    -webkit-appearance: none;
    -webkit-tap-highlight-color: transparent;
}

.label-overlay:focus,
.label-overlay:focus-visible {
    outline: none;
    box-shadow: none;
}

.label-overlay:active {
    background: transparent;
}

.label-overlay::-moz-focus-inner {
    border: 0;
}

.ring-bg {
    fill: none;
    stroke: #e5e5e5;
    stroke-width: 20;
}

/* Segment arcs - large hit area */
.segment {
    fill: none;
    stroke: transparent;
    stroke-width: 36;
    cursor: pointer;
    transition: stroke 0.15s ease;
}

.segment:hover {
    stroke: rgba(0, 0, 0, 0.05);
}

.segment.active {
    stroke: rgba(0, 0, 0, 0.08);
}

/* Progress arc */
.progress-arc {
    fill: none;
    stroke: #1a1a1a;
    stroke-width: 20;
    stroke-linecap: round;
}

/* Marker dot */
.marker {
    fill: #1a1a1a;
    transition: transform 0.05s linear;
}

/* Labels */
.label {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 14px;
    font-weight: 500;
    fill: #777;
    text-anchor: middle;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: fill 0.15s ease, font-weight 0.15s ease;
    user-select: none;
    cursor: pointer;
    pointer-events: auto;
    /* White outline so text is readable over progress arcs */
    paint-order: stroke fill;
    stroke: #fafafa;
    stroke-width: 4px;
    stroke-linejoin: round;
}

.label:hover {
    fill: #444;
}

.label.active {
    fill: #1a1a1a;
    font-weight: 600;
}

/* Video container - centered inside ring */
.video-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 58%;
    height: 58%;
    border-radius: 50%;
    overflow: hidden;
    background: transparent;
}

.video-container.playing {
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
}

#cycle-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#cycle-video.playing {
    opacity: 1;
}

/* Intro text */
.intro-copy {
    position: absolute;
    top: 52%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: min(360px, 76%);
    padding: 0 0.75rem;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #4b4b4b;
    opacity: 1;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 3;
}

.intro-text {
    pointer-events: none;
    opacity: 0;
    transition: opacity 2.6s ease;
}

.intro-copy.visible .intro-text {
    opacity: 1;
}

.intro-copy.visible .intro-text:nth-of-type(2) {
    transition-delay: 1.4s;
}

.intro-copy.hidden {
    opacity: 0;
}

.intro-text--top {
    margin-bottom: 1.5rem;
    transform: translateY(-40px);
}

.intro-text--bottom {
    margin-top: 3.5rem;
}

/* Center controls */
.center-controls {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    transition: opacity 0.2s ease;
    pointer-events: auto;
}

.center-controls.hidden {
    opacity: 0;
    pointer-events: none;
}

button {
    font-family: 'Inter', sans-serif;
    background: none;
    border: 1px solid #ccc;
    color: #1a1a1a;
    padding: 0.75rem 1.5rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    border-radius: 2px;
    letter-spacing: 0.02em;
}

button:hover {
    border-color: #1a1a1a;
}

button:active {
    background: #f0f0f0;
}

#play-pause {
    width: 52px;
    height: 52px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.play-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-icon svg {
    display: block;
    width: 24px;
    height: 24px;
}

.replay-icon svg {
    display: block;
    width: 30px;
    height: 30px;
    transition: transform 0.2s ease;
}

#play-pause:hover .replay-icon svg {
    transform: rotate(90deg);
}

/* Hint text */
.hint {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-size: 0.9375rem;
    font-style: italic;
    color: #999;
    text-align: center;
}

/* Attribution */
/* Footer */
footer {
    margin-top: 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
    text-align: center;
    width: 100%;
}

.footer-text {
    font-size: 0.6875rem;
    color: rgba(0, 0, 0, 0.4);
}

.footer-text + .footer-text {
    margin-top: 0.35rem;
}

.footer-text.copyright {
    color: rgba(0, 0, 0, 0.3);
    letter-spacing: 0.04em;
}

.footer-text a {
    color: #555;
    text-decoration: none;
    transition: color 0.15s ease;
}

.footer-text a:hover {
    color: #1a1a1a;
}

/* Responsive - mobile */
@media (max-width: 600px) {
    h1 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.875rem;
    }

    .visualization {
        max-width: min(90vw, 400px);
        margin-top: 115px;
    }

    .label {
        font-size: 13px;
        letter-spacing: 0.08em;
    }

    /* Position intro text above the circle on mobile */
    .intro-copy {
        position: absolute;
        top: -110px;
        left: 50%;
        transform: translateX(-50%);
        width: 92%;
        max-width: 360px;
        font-size: 0.8rem;
        line-height: 1.4;
        padding: 0;
    }

    .intro-text--top {
        margin-bottom: 0.5rem;
        transform: none;
    }

    .intro-text--bottom {
        margin-top: 0;
    }

    .hint {
        font-size: 0.8125rem;
    }

    /* Adjust center controls for mobile */
    .center-controls button {
        width: 50px;
        height: 50px;
    }
}

/* Larger screens - go bigger */
@media (min-width: 900px) {
    .visualization {
        max-width: 600px;
    }

    h1 {
        font-size: 4rem;
    }

    .label {
        font-size: 15px;
    }
}

@media (min-width: 1200px) {
    .visualization {
        max-width: 650px;
    }
}
