/* ============================================
   CSS Variables & Reset
   ============================================ */

:root {
    /* Colors - Clean, modern palette */
    --color-bg: rgb(253, 251, 247);
    --color-text: #1d1d1f;
    --color-text-muted: #86868b;
    --color-divider: #e5e5e7;

    /* Typography */
    --font-system: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;

    /* Spacing */
    --space-unit: 1rem;
    --space-sm: calc(var(--space-unit) * 1);
    --space-md: calc(var(--space-unit) * 2);
    --space-lg: calc(var(--space-unit) * 3);
    --space-xl: calc(var(--space-unit) * 4);
}

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

/* ============================================
   Base Styles
   ============================================ */

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-system);
    font-weight: 400;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition-property: background-color, color;
    transition-duration: 1000ms;
}

/* ============================================
   Main Content
   ============================================ */

.content {
    flex: 1;
    max-width: 35rem;
    margin: 0 auto;
    padding: var(--space-xl) var(--space-md);
    width: 100%;
    box-sizing: border-box;
}

/* ============================================
   Delicate Fade-In Animation Keyframes
   ============================================ */

@keyframes delicate-fade-in {
    to {
        opacity: 1;
        filter: blur(0);
        transform: translateY(0);
    }
}

/* ============================================
   Back Link
   ============================================ */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-text-muted);
    font-size: 0.9375rem;
    margin-bottom: var(--space-lg);
    transition: color 0.3s ease;

    /* Entrance animation - 0ms delay */
    opacity: 0;
    filter: blur(1px);
    transform: translateY(10px);
    animation: delicate-fade-in 1.5s cubic-bezier(0.2, 0.9, 0.1, 1) forwards;
    animation-delay: 0ms;
}

.back-link:hover {
    color: var(--color-text);
}

.back-arrow {
    display: inline-block;
    font-size: 1.125rem;
    transition: transform 0.3s ease;
}

.back-link:hover .back-arrow {
    transform: translateX(-4px);
}

/* ============================================
   Progress Indicator
   ============================================ */

.progress-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--space-lg);
    gap: 1rem;

    /* Entrance animation - 50ms delay */
    opacity: 0;
    filter: blur(1px);
    transform: translateY(10px);
    animation: delicate-fade-in 1.5s cubic-bezier(0.2, 0.9, 0.1, 1) forwards;
    animation-delay: 50ms;
}

.progress-step {
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    border: 1.5px solid var(--color-divider);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-text-muted);
    background-color: var(--color-bg);
    transition: all 0.3s ease;
}

.progress-step.active {
    border-color: var(--color-text);
    color: var(--color-text);
    background-color: var(--color-bg);
}

.progress-step.completed {
    border-color: var(--color-text);
    background-color: var(--color-text);
    color: var(--color-bg);
}

.progress-step.check {
    font-size: 1rem;
    font-weight: 600;
}

.progress-line {
    width: 3rem;
    height: 1.5px;
    background-color: var(--color-divider);
    transition: all 0.3s ease;
}

.progress-line.completed {
    background-color: var(--color-text);
}

.progress-line.in-progress {
    background: linear-gradient(to right, var(--color-text) 0%, var(--color-text) 50%, var(--color-divider) 50%, var(--color-divider) 100%);
}

/* ============================================
   Page Title
   ============================================ */

.page-title {
    font-size: 2.5rem;
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: var(--space-md);

    /* Entrance animation - 100ms delay */
    opacity: 0;
    filter: blur(1px);
    transform: translateY(10px);
    animation: delicate-fade-in 1.5s cubic-bezier(0.2, 0.9, 0.1, 1) forwards;
    animation-delay: 100ms;
}

/* ============================================
   Steps Container
   ============================================ */

.steps {
    /* Entrance animation - 200ms delay */
    opacity: 0;
    filter: blur(1px);
    transform: translateY(10px);
    animation: delicate-fade-in 1.5s cubic-bezier(0.2, 0.9, 0.1, 1) forwards;
    animation-delay: 200ms;
}

/* ============================================
   Individual Step
   ============================================ */

.step {
    margin-bottom: var(--space-md);
}

.step-number {
    font-size: 1.125rem;
    font-weight: 500;
    line-height: 1.4;
    color: var(--color-text);
    margin-bottom: 0.5rem;
}

.step-description {
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--color-text-muted);
}

.primary-instruction {
    font-size: 1rem;
}

.secondary-instruction {
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    opacity: 0.8;
}

.optional-section {
    margin-top: 0;
}

.optional-heading {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.help-section {
    margin-top: var(--space-lg);
}

.help-toggle {
    font-family: var(--font-system);
    font-size: 0.9375rem;
    font-weight: 400;
    color: var(--color-text-muted);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: color 0.3s ease;
}

.help-toggle:hover {
    color: var(--color-text);
}

.help-toggle:focus {
    outline: none;
}

.toggle-arrow {
    display: inline-block;
    font-size: 0.875rem;
    transition: transform 0.3s ease;
}

.help-content {
    margin-top: 0.75rem;
    padding-left: 0;
}

.help-heading {
    font-size: 0.8125rem;
    color: var(--color-text-muted);
    margin-bottom: 0.5rem;
}

.input-wrapper {
    margin-top: var(--space-sm);
}

.homepage-input {
    font-family: var(--font-system);
    font-size: 0.9375rem;
    color: var(--color-text);
    background-color: var(--color-bg);
    border: 1.5px solid var(--color-divider);
    border-radius: 4px;
    padding: 0.75rem 1rem;
    width: 100%;
    transition: all 0.3s ease;
}

.homepage-input:focus {
    outline: none;
    border-color: var(--color-text);
}

.homepage-input::placeholder {
    color: var(--color-text-muted);
    opacity: 0.5;
}

.input-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: 0.5rem;
    line-height: 1.5;
}

/* ============================================
   Divider
   ============================================ */

.divider {
    width: 100%;
    height: 1px;
    background-color: var(--color-divider);
    margin: var(--space-lg) 0;
}

/* ============================================
   Final Note
   ============================================ */

.final-note {
    margin-top: var(--space-md);
}

.note-text {
    font-size: 0.9375rem;
    font-weight: 400;
    line-height: 1.7;
    color: var(--color-text-muted);
}

/* ============================================
   Browser Selector
   ============================================ */

.browser-selector {
    text-align: center;
    margin-bottom: var(--space-md);
}

.browser-label {
    font-size: 0.9375rem;
    color: var(--color-text);
    font-weight: 400;
    display: block;
    margin-bottom: var(--space-sm);
}

.segmented-control {
    display: inline-flex;
    background-color: rgba(0, 0, 0, 0.04);
    border-radius: 6px;
    padding: 3px;
    gap: 0;
}

.segment {
    font-family: var(--font-system);
    font-size: 0.875rem;
    font-weight: 400;
    color: var(--color-text);
    background-color: transparent;
    border: none;
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.segment:hover {
    color: var(--color-text);
}

.segment.active {
    background-color: var(--color-bg);
    color: var(--color-text);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    font-weight: 500;
}

.segment:focus {
    outline: none;
}

.browser-instructions {
    margin-bottom: var(--space-lg);
    text-align: left;
}

.instruction-intro {
    font-size: 1rem;
    color: var(--color-text);
    line-height: 1.7;
    margin-bottom: 0.5rem;
}

.instruction-text {
    font-size: 1rem;
    color: var(--color-text-muted);
    line-height: 1.7;
}

/* ============================================
   Onboarding CTA
   ============================================ */

.onboarding-cta {
    margin-top: var(--space-xl);
    text-align: center;
}

.cta-button {
    font-family: var(--font-system);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.2;
    letter-spacing: 0.025em;
    color: #ffffff;
    background-color: #1d1d1f;
    text-decoration: none;
    border: none;
    border-radius: 9999px;
    padding: 0.875rem 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.cta-button:hover {
    background-color: rgba(29, 29, 31, 0.9);
    box-shadow:
        0 10px 25px -5px rgba(29, 29, 31, 0.2),
        0 10px 10px -5px rgba(29, 29, 31, 0.04),
        0 0 40px 5px rgba(29, 29, 31, 0.05);
}

.cta-button:active {
    transform: scale(0.98);
}

.cta-arrow {
    display: inline-block;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-size: 1.125rem;
}

.cta-button:hover .cta-arrow {
    transform: translateX(4px);
}

.cta-hint {
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-top: var(--space-sm);
    text-align: center;
}

/* ============================================
   Responsive Design
   ============================================ */

@media (max-width: 768px) {
    .content {
        padding: var(--space-md) var(--space-md);
    }

    .page-title {
        font-size: 2rem;
        margin-bottom: var(--space-md);
    }

    .step {
        margin-bottom: var(--space-md);
    }

    .divider {
        margin: var(--space-md) 0;
    }
}

/* ============================================
   URL Copy Link
   ============================================ */

.url-copy {
    color: var(--color-text);
    text-decoration: underline;
    text-decoration-color: var(--color-text-muted);
    text-underline-offset: 2px;
    transition: text-decoration-color 0.2s ease;
    cursor: pointer;
    position: relative;
}

.url-copy:hover {
    text-decoration-color: var(--color-text);
}

/* Tooltip */
.url-copy::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 4px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--color-text);
    color: var(--color-bg);
    padding: 0.375rem 0.625rem;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.url-copy:hover::after {
    opacity: 1;
}

.url-copy.copied::after {
    opacity: 1;
}

.url-copy.copied {
    text-decoration-color: #86868b;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
