/* ==========================================================================
   TimeLooper — landing page
   Self-contained: no framework, no external fonts, no remote assets.
   ========================================================================== */

:root {
    --bg:            #07080c;
    --bg-elev:       #0d0f16;
    --line:          rgba(255, 255, 255, 0.09);
    --line-strong:   rgba(255, 255, 255, 0.16);
    --ink:           #f4f5f7;
    --ink-dim:       #9aa1ae;
    --ink-faint:     #5d6472;
    --accent:        #6c8cff;
    --accent-warm:   #b678ff;
    --focus:         #8fa6ff;

    --measure:       62ch;
    --radius:        14px;
    --pad-x:         clamp(1.25rem, 5vw, 4.5rem);

    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
            "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: var(--font);
    font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

/* Ambient glow. Fixed + non-interactive so it never blocks clicks or scrolls. */
body::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    background:
        radial-gradient(60rem 34rem at 12% -8%, rgba(108, 140, 255, 0.40), transparent 60%),
        radial-gradient(48rem 30rem at 78% -14%, rgba(182, 120, 255, 0.28), transparent 62%);
}

.page {
    position: relative;
    z-index: 1;
    height: 100vh;
    height: 100svh;
    display: flex;
    flex-direction: column;
    max-width: 1180px;
    margin-inline: auto;
    padding-inline: var(--pad-x);
}

.skip-link {
    position: absolute;
    left: -9999px;
    top: 0;
    padding: 0.7rem 1rem;
    background: var(--ink);
    color: var(--bg);
    border-radius: 0 0 var(--radius) 0;
    font-weight: 650;
    z-index: 10;
}
.skip-link:focus { left: 0; }

/* ---------- header ---------- */

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex: none;
    padding-block: clamp(1rem, 2.2vh, 1.6rem);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: var(--ink);
    text-decoration: none;
    font-weight: 660;
    letter-spacing: -0.015em;
    font-size: 1.0625rem;
}

.brand-mark {
    display: grid;
    place-items: center;
    /* Logo is 300x150 (2:1) — keep the box on that ratio so it never distorts. */
    width: 64px;
    height: 32px;
    flex: none;
}

.brand-mark img,
.brand-mark svg {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.brand-word { white-space: nowrap; }

.nav-actions {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.75rem);
}


/* ---------- buttons ---------- */

.btn {
    --btn-bg: transparent;
    --btn-fg: var(--ink);
    --btn-bd: var(--line-strong);

    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.72rem 1.15rem;
    border: 1px solid var(--btn-bd);
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font: inherit;
    font-weight: 600;
    line-height: 1.15;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: transform 140ms ease, background-color 140ms ease,
                border-color 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

.btn-primary {
    --btn-bd: transparent;
    --btn-fg: #0a0b10;
    background: linear-gradient(135deg, #e8ecff 0%, #ffffff 55%, #efe6ff 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset,
                0 10px 30px -12px rgba(108, 140, 255, 0.55);
}
.btn-primary:hover {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.5) inset,
                0 16px 40px -14px rgba(108, 140, 255, 0.7);
}

.btn-ghost {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(6px);
}
.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--line-strong);
}


.btn-lg { padding: 0.9rem 1.5rem; font-size: 1.03rem; }

.btn-arrow {
    width: 1em;
    height: 1em;
    flex: none;
    transition: transform 160ms ease;
}
.btn:hover .btn-arrow { transform: translateX(3px); }

/* ---------- hero ---------- */

main {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-evenly;
    gap: clamp(0.9rem, 2.4vh, 2rem);
    padding-block: clamp(0.4rem, 1.2vh, 1rem);
}

/* Rows must be allowed to shrink, never to overflow the locked page height. */
main > section { flex: 0 0 auto; min-height: 0; }

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3.5rem);
    align-items: center;
}

.hero-copy { min-width: 0; }

@media (max-width: 60rem) {
    .hero { grid-template-columns: 1fr; }
    .panel { display: none; }
}

.eyebrow {
    margin: 0 0 clamp(0.6rem, 1.6vh, 1.2rem);
    font-family: var(--mono);
    font-size: 0.74rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.hero-title {
    margin: 0;
    max-width: 22ch;
    text-wrap: balance;
    font-size: clamp(1.9rem, min(4.6vw, 6.2vh), 3.6rem);
    line-height: 1.02;
    letter-spacing: -0.035em;
    font-weight: 680;
    background: linear-gradient(180deg, #ffffff 30%, #b9c0d0 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
/* Safari/Chrome need the transparent fill for the gradient text to show. */
@supports (-webkit-text-fill-color: transparent) {
    .hero-title { -webkit-text-fill-color: transparent; }
}

.hero-sub {
    margin: clamp(0.6rem, 1.6vh, 1.1rem) 0 0;
    max-width: 54ch;
    font-size: clamp(0.95rem, 0.9rem + 0.3vw, 1.1rem);
    line-height: 1.5;
    color: var(--ink-dim);
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.85rem 1.1rem;
    margin-top: clamp(1rem, 3vh, 2.25rem);
}

/* ---------- hero side panel ---------- */

.panel {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012));
    padding: clamp(1rem, 2.4vh, 1.6rem) clamp(1rem, 2vw, 1.5rem);
    min-width: 0;
}

.panel-head,
.panel-foot {
    margin: 0;
    font-family: var(--mono);
    font-size: 0.68rem;
    letter-spacing: 0.13em;
    text-transform: uppercase;
    color: var(--ink-faint);
}

.flow {
    list-style: none;
    margin: clamp(0.7rem, 2vh, 1.15rem) 0;
    padding: 0 0 0 0.9rem;
    display: grid;
    gap: clamp(0.5rem, 1.5vh, 0.95rem);
    border-left: 1px solid var(--line-strong);
}

.flow-step {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.15rem 0.55rem;
    min-width: 0;
}

.flow-dot {
    position: absolute;
    left: calc(-0.9rem - 1px);
    top: 0.5em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent);
    transform: translateX(-50%);
    box-shadow: 0 0 0 3px var(--bg);
}
.flow-step:nth-child(3) .flow-dot { background: var(--accent-warm); }
.flow-step:nth-child(4) .flow-dot { background: #6ee7b7; }

.flow-label {
    font-size: 0.95rem;
    font-weight: 620;
    letter-spacing: -0.005em;
    color: var(--ink);
}

.flow-note {
    font-size: 0.83rem;
    color: var(--ink-faint);
    min-width: 0;
}

.panel-foot { border-top: 1px solid var(--line); padding-top: 0.75rem; text-transform: none; letter-spacing: 0.02em; font-family: var(--font); font-size: 0.82rem; color: var(--ink-faint); }

/* ---------- pillars ---------- */

.pillars {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
}

.pillar {
    background: var(--bg-elev);
    padding: clamp(0.95rem, 2.2vh, 1.6rem) clamp(1.1rem, 2.2vw, 1.6rem);
    transition: background-color 200ms ease;
}
.pillar:hover { background: #12151f; }

.pillar-step {
    display: block;
    font-family: var(--mono);
    font-size: 0.72rem;
    letter-spacing: 0.1em;
    color: var(--accent);
    margin-bottom: clamp(0.4rem, 1.1vh, 0.8rem);
}

.pillar h2 {
    margin: 0 0 0.4rem;
    font-size: 1.075rem;
    font-weight: 640;
    letter-spacing: -0.01em;
}

.pillar p {
    margin: 0;
    font-size: clamp(0.8rem, 0.76rem + 0.2vw, 0.885rem);
    line-height: 1.5;
    color: var(--ink-dim);
    text-wrap: pretty;
}

/* ---------- closer ---------- */

.closer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: clamp(0.9rem, 2vw, 1.5rem);
    padding-bottom: clamp(0.25rem, 1vh, 0.75rem);
}

.caps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(0.75rem, 2.5vw, 2.25rem);
    flex: 1 1 34rem;
    min-width: 0;
}

.caps li {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
    padding-left: 0.85rem;
    border-left: 2px solid var(--line-strong);
}

.caps-k {
    font-family: var(--mono);
    font-size: 0.66rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}

.caps-v {
    font-size: clamp(0.78rem, 0.74rem + 0.18vw, 0.9rem);
    line-height: 1.4;
    color: var(--ink-dim);
    text-wrap: pretty;
}

/* Short viewports: the closer row is the first thing to lose breathing room,
   so trim it rather than let it press against the footer. */
@media (max-height: 50rem) {
    .caps { gap: clamp(0.6rem, 1.8vw, 1.4rem); }
    .caps-v { font-size: 0.78rem; line-height: 1.35; }
    .pillar p { font-size: 0.8rem; line-height: 1.45; }
}

@media (max-width: 46rem) {
    .caps { grid-template-columns: 1fr; }
}

/* ---------- footer ---------- */

.foot {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex: none;
    padding-block: clamp(0.7rem, 1.6vh, 1.25rem);
    border-top: 1px solid var(--line);
    font-size: 0.85rem;
    color: var(--ink-faint);
}
.foot-sep { opacity: 0.5; }

.foot a {
    color: var(--ink-faint);
    text-decoration: none;
}
.foot a:hover { color: var(--ink-dim); text-decoration: underline; }
.foot a:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- responsive / preferences ---------- */

/* Escape hatch: below this the one-screen constraint would crush the content,
   so let the page grow and scroll normally instead of squeezing it. */
@media (max-width: 48rem), (max-height: 34rem) {
    .page { height: auto; min-height: 100svh; }
    main {
        justify-content: flex-start;
        gap: clamp(1.75rem, 5vh, 3rem);
        padding-block: clamp(1.5rem, 4vh, 3rem) 0;
    }
    .closer { padding-block: clamp(2rem, 6vh, 3.5rem) 0; }
}

@media (max-width: 30rem) {
    .hero-cta .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .btn:hover { transform: none; }
    .btn:hover .btn-arrow { transform: none; }
}

/* This page is a deliberate dark design; keep it stable if the OS asks for light. */
@media print {
    body::before { display: none; }
    body { background: #fff; color: #000; }
}
