/* freedom.compare -- a graduated instrument panel */

:root {
    --surface: #FAFAFA;
    --spine: #B0B0B0;
    --rule: #D0D0D0;
    --rule-strong: #999999;
    --mid: #666666;
    --body: #333333;
    --anchor: #1A1A1A;
    --zebra: #E8E8E8;
    --soft: #888888;
    --col-width: min(680px, 100% - clamp(3rem, 10vw, 6rem));
    --baseline: 8px;
    --section-gap: calc(var(--baseline) * 9);
}

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

html {
    background: var(--surface);
}

body {
    background: var(--surface);
    color: var(--body);
    font-family: 'DM Sans', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    font-size: clamp(1rem, 1.8vw, 1.125rem);
    line-height: 1.7;
    letter-spacing: 0.005em;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* The Graduated Spine -- a thin vertical line down the center of the viewport */
.spine {
    position: absolute;
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    background: var(--spine);
    transform: translateX(-50%);
    pointer-events: none;
    opacity: 0;
    animation: spine-fade-in 600ms ease-in 100ms forwards;
    z-index: 0;
}

@keyframes spine-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Scale ticks along the spine -- 4px diamonds */
.tick {
    position: absolute;
    left: 50%;
    width: 4px;
    height: 4px;
    background: var(--rule);
    transform: translate(-50%, -50%) rotate(45deg);
    pointer-events: none;
}

/* Spine chevron -- compass needle tip at bottom */
.chevron {
    position: absolute;
    bottom: 0;
    left: 50%;
    width: 12px;
    height: 12px;
    transform: translate(-50%, 50%) rotate(45deg);
    border-right: 1px solid var(--spine);
    border-bottom: 1px solid var(--spine);
    background: transparent;
}

/* Page container */
.page {
    position: relative;
    z-index: 1;
    width: var(--col-width);
    max-width: 680px;
    margin-inline: auto;
    padding-inline: clamp(1.5rem, 5vw, 3rem);
    padding-block: 6rem;
}

/* === Opener === */
.opener {
    min-height: 90vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    position: relative;
    padding-top: 6rem;
    padding-bottom: 6rem;
}

.domain {
    position: absolute;
    top: 2rem;
    left: 0;
    font-size: 14px;
    font-weight: 300;
    color: var(--soft);
    letter-spacing: 0.02em;
}

.opener-title {
    font-weight: 600;
    font-size: clamp(2.5rem, 5vw, 4rem);
    line-height: 1.08;
    letter-spacing: -0.04em;
    color: var(--anchor);
    margin-bottom: 3rem;
}

.opener-title .reveal {
    display: inline-block;
    clip-path: inset(0 100% 0 0);
    animation: title-reveal 800ms cubic-bezier(0.22, 1, 0.36, 1) 200ms forwards;
}

@keyframes title-reveal {
    from { clip-path: inset(0 100% 0 0); }
    to   { clip-path: inset(0 0 0 0); }
}

.opener-rule {
    height: 1px;
    width: 100%;
    background: #C0C0C0;
}

/* === Comparison Frames === */
.frame {
    position: relative;
    margin-block: var(--section-gap);
    padding: 3rem clamp(1.5rem, 4vw, 2.5rem) 2.5rem;
    border: 1px solid var(--rule);
    opacity: 0;
    transition: opacity 400ms ease-out, transform 250ms ease-out, border-color 250ms ease-out;
    will-change: opacity, transform;
}

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

.frame-light {
    background: var(--surface);
}

.frame-dark {
    background: var(--zebra);
}

@media (hover: hover) {
    .frame:hover {
        transform: scale(1.015);
        border-color: var(--rule-strong);
    }

    .frame:hover .frame-index {
        color: var(--anchor);
    }
}

/* Frame Header -- label flush left, hairline rule extending right */
.frame-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2.5rem;
    padding-top: 0;
}

.frame-header h2 {
    font-weight: 500;
    font-size: 0.75rem;
    line-height: 1.0;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--mid);
    white-space: nowrap;
}

.frame-rule {
    flex: 1;
    height: 1px;
    background: var(--rule);
}

/* Frame Body */
.frame-body p {
    color: var(--body);
    margin-bottom: 2rem;
}

.frame-body p:last-child {
    margin-bottom: 0;
}

.pull-quote {
    font-weight: 600;
    font-size: clamp(1.25rem, 2.5vw, 1.75rem);
    line-height: 1.35;
    letter-spacing: -0.02em;
    color: var(--anchor) !important;
    margin-block: 2.5rem !important;
}

/* Comparison Pair Divider -- 80px line with centered diamond fulcrum */
.pair-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 1px;
    width: 80px;
    margin: 2.5rem auto;
    background: var(--rule-strong);
    position: relative;
}

.pair-divider .diamond {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 6px;
    height: 6px;
    transform: translate(-50%, -50%) rotate(45deg);
    border: 1px solid var(--rule-strong);
    background: transparent;
    transition: background 200ms ease-out, border-color 200ms ease-out;
    cursor: crosshair;
}

.pair-divider .diamond:hover {
    background: var(--anchor);
    border-color: var(--anchor);
}

/* Frame Footer */
.frame-footer {
    margin-top: 2.5rem;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0;
}

.frame-bottom-rule {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--rule);
    transition: background 250ms ease-out;
}

.frame-index {
    font-family: 'DM Sans', monospace;
    font-weight: 300;
    font-size: 0.625rem;
    letter-spacing: 0.08em;
    color: var(--rule-strong);
    transform: rotate(-2deg);
    display: inline-block;
    padding-top: 0.5rem;
    transition: color 250ms ease-out;
}

/* Frame terminator diamond -- centered below frame */
.frame-terminator {
    position: absolute;
    left: 50%;
    bottom: -1.5rem;
    width: 6px;
    height: 6px;
    transform: translate(-50%, 50%) rotate(45deg);
    border: 1px solid var(--spine);
    background: transparent;
}

/* === Closer === */
.closer {
    min-height: 60vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-top: 4rem;
    padding-bottom: 4rem;
    text-align: center;
}

.closer p {
    font-size: 12px;
    font-weight: 300;
    color: var(--soft);
    letter-spacing: 0.02em;
}

/* Hyperlinks */
a {
    color: inherit;
    text-decoration: underline;
    text-decoration-color: var(--spine);
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
    transition: text-decoration-color 200ms ease-out, color 200ms ease-out;
}

a:hover {
    text-decoration-color: var(--anchor);
    color: var(--anchor);
}

/* Responsive tweaks */
@media (max-width: 600px) {
    .domain {
        top: 1.5rem;
    }

    .frame {
        padding: 2.5rem 1.5rem 2rem;
    }

    .opener {
        min-height: 80vh;
    }
}
