/* base.css — tokens, reset, corner chrome, hire CTA flight */

:root {
    --bg: #000000;
    --ink: #ffffff;
    --muted: #a0a0b0;
    --accent: #ffffff;
    --line: #ffffff;
    --font-display: 'Outfit', sans-serif;
    --font-body: 'Outfit', sans-serif;
    --radius: 12px;
    --field: #ffffff;
    --field-a: 0.5;
    --bg-image: none;
    --bg-size: auto;
    --bg-a: 0;
    --logo-size: 1.5rem;
    --logo-style: normal;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
}

body {
    font-family: var(--font-body);
    background-color: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
    transition: background-color 0.4s, color 0.4s;
}

/* Theme background graphic layer — each theme sets --bg-image */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: var(--bg-image);
    background-size: var(--bg-size);
    opacity: var(--bg-a);
}

/* Corner chrome */

.corner { position: fixed; z-index: 20; }
.corner-tl { top: 0; left: 0; padding: 1.6rem 5vw; }

/* Footer chrome — cue left, contact right. Pass-through between children. */
.foot-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 20;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: 1.4rem 5vw;
    pointer-events: none;
}
.foot-bar > * { pointer-events: auto; }

.foot-mail {
    position: fixed;
    right: 5vw;
    bottom: 1.4rem;
    z-index: 20;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-decoration: none;
    transition: right 0.6s cubic-bezier(0.7, 0, 0.3, 1),
        bottom 0.6s cubic-bezier(0.7, 0, 0.3, 1),
        transform 0.6s cubic-bezier(0.7, 0, 0.3, 1),
        font-size 0.6s, color 0.2s;
}
.foot-mail:hover { color: var(--accent); }

/* At the true bottom the handle leaves the footer and lands centered
   just under the landed CTA; scrolling up sends it home. */
body.at-bottom .foot-mail {
    right: 50%;
    bottom: calc(50vh - 95px);
    transform: translateX(50%);
    font-size: 1.05rem;
    color: var(--ink);
}

/* Logo IS the theme button — its color/font/size ARE the theme */
.logo {
    font-family: var(--font-display);
    font-style: var(--logo-style);
    font-weight: 800;
    font-size: var(--logo-size);
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--accent);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.4s, font-size 0.4s;
}
.logo:hover { filter: brightness(1.25); }

/* Hire CTA — fixed top-right. Shakes with ramping amplitude as the
   user scrolls (--shake 0→1); at the bottom it flies to center and
   lands big. JS drives --shake + state classes. */
.btn-hire-top {
    position: fixed;
    top: 1.6rem;
    right: 5vw;
    z-index: 30;
    display: inline-block;
    padding: 0.55rem 1.2rem;
    border: 2px solid var(--line);
    border-radius: var(--radius);
    background: transparent;
    color: var(--ink);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    transform-origin: top right;
    transition: top 0.6s cubic-bezier(0.7, 0, 0.3, 1),
        right 0.6s cubic-bezier(0.7, 0, 0.3, 1),
        transform 0.6s cubic-bezier(0.7, 0, 0.3, 1),
        background 0.2s, color 0.2s, border-color 0.4s;
}
.btn-hire-top:hover { background: var(--accent); border-color: var(--accent); color: var(--bg); }

.btn-hire-top.shaking { animation: shake-corner 0.16s linear infinite; }

.btn-hire-top.hire-landed {
    top: 50%;
    right: 50%;
    transform: translate(50%, -50%) scale(2.4);
    transform-origin: center;
    background: var(--accent);
    border-color: var(--accent);
    color: var(--bg);
}
.btn-hire-top.hire-landed.shaking { animation: shake-center 0.16s linear infinite; }

@keyframes shake-corner {
    0% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(calc(3px * var(--shake)), calc(-2px * var(--shake))) rotate(calc(0.5deg * var(--shake))); }
    50% { transform: translate(calc(-3px * var(--shake)), calc(2px * var(--shake))) rotate(calc(-0.5deg * var(--shake))); }
    75% { transform: translate(calc(2px * var(--shake)), calc(2px * var(--shake))) rotate(calc(0.4deg * var(--shake))); }
    100% { transform: translate(calc(-2px * var(--shake)), calc(-2px * var(--shake))) rotate(calc(-0.4deg * var(--shake))); }
}

@keyframes shake-center {
    0% { transform: translate(50%, -50%) scale(2.4) translate(0, 0); }
    25% { transform: translate(50%, -50%) scale(2.4) translate(calc(4px * var(--shake)), calc(-3px * var(--shake))); }
    50% { transform: translate(50%, -50%) scale(2.4) translate(calc(-4px * var(--shake)), calc(3px * var(--shake))); }
    75% { transform: translate(50%, -50%) scale(2.4) translate(calc(3px * var(--shake)), calc(4px * var(--shake))); }
    100% { transform: translate(50%, -50%) scale(2.4) translate(calc(-3px * var(--shake)), calc(-4px * var(--shake))); }
}

main { position: relative; z-index: 10; }

@media (prefers-reduced-motion: reduce) {
    .btn-hire-top,
    .foot-mail { transition: none; }
    .btn-hire-top.shaking,
    .btn-hire-top.hire-landed.shaking { animation: none; }
}
