/* deck.css — the agent log deck.
   ---------------------------------------------------------------------------
   The ONE copy of the deck's stacking geometry. Shared by ai.html §5 (the
   "An employee that never sleeps" section) and index.html §3 (the hand-off to
   the AI page); both <link> this file and both render <AgentDeck> from
   hifi/mocks/agent-deck.jsx.

   Absolute stacking, transitions and the per-category hue ramp cannot be
   expressed as inline styles, so they live here; the component owns the copy,
   the timing and which card is active.

   Two custom properties are declared here because nothing outside the deck
   uses them: --log-card-h and --log-gap. The easing var --ease-deck is NOT
   declared here on purpose — it is a page-level token that both pages already
   set in their own <style> block and that their scroll-reveal CSS also uses,
   so declaring it here would override the page's value.

   The `.cd-employee.is-deck` ancestor is applied by AgentDeck to its `hostRef`
   element. That host is the whole section, not the <ol>, because
   `.cd-employee.is-deck .cd-log-trail` targets the headline's second half,
   which is a SIBLING of the deck rather than a child of it.
   --------------------------------------------------------------------------- */

:root {
    --log-card-h: 168px;
    --log-gap: 14px;
}

.cd-log {
    display: flex;
    flex-direction: column;
    gap: var(--log-gap);
}
.cd-log__card {
    background: linear-gradient(
        180deg,
        oklch(0.995 0.014 var(--hue, 258)),
        oklch(0.955 0.036 var(--hue, 258))
    );
    border: 1px solid oklch(0.86 0.045 var(--hue, 258) / 0.5);
    border-radius: 22px;
    box-shadow:
        0 1px 2px rgba(20, 22, 40, 0.03),
        0 22px 50px -30px rgba(20, 22, 50, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    padding: 24px 28px 26px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
}
.cd-log__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}
.cd-log__time {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: oklch(0.58 0.045 var(--hue, 258));
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.cd-log__tag {
    font-family: "DM Mono", ui-monospace, monospace;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    color: oklch(0.45 0.11 var(--hue, 258));
    background: oklch(0.94 0.05 var(--hue, 258));
    padding: 4px 9px;
    border-radius: 999px;
    white-space: nowrap;
}
.cd-log__text {
    margin: 0;
    font-size: clamp(16px, 1.5vw, 19px);
    line-height: 1.45;
    font-weight: 500;
    letter-spacing: -0.022em;
    color: #16181d;
    text-wrap: pretty;
}

/* deck mode, layered on top of the plain list above */
.cd-employee.is-deck .cd-log {
    position: relative;
    display: block;
    /* room for two full cards (active + prev) plus headroom for the
       receding paper stack behind them */
    height: calc(var(--log-card-h) * 2 + var(--log-gap) + 56px);
    width: 100%;
    margin-top: -6px;
    margin-bottom: 0;
}
/* the active card sits flush at the deck's bottom edge and carries a
   wide shadow, so the trailing headline needs real clearance */
.cd-employee.is-deck .cd-log-trail {
    margin-top: 64px;
}
.cd-employee.is-deck .cd-log__card {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--log-card-h);
    transform-origin: bottom center;
    will-change: transform, opacity;
    transition:
        transform 0.58s var(--ease-deck),
        opacity 0.42s ease,
        box-shadow 0.58s var(--ease-deck);
    /* default: waiting below, out of sight */
    opacity: 0;
    transform: translate3d(0, 34px, 0) scale(0.97);
    z-index: 1;
}
.cd-employee.is-deck .cd-log__card.is-active {
    opacity: 1;
    transform: none;
    z-index: 40;
    box-shadow:
        0 2px 4px rgba(20, 22, 40, 0.04),
        0 36px 72px -34px rgba(20, 22, 50, 0.34),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}
/* a full card-height above the active one, a real gap and not a
   sliver, so two entries are genuinely both readable */
.cd-employee.is-deck .cd-log__card.is-prev {
    opacity: 1;
    transform: translate3d(
            0,
            calc(-1 * (var(--log-card-h) + var(--log-gap))),
            0
        )
        scale(0.98);
    z-index: 35;
    box-shadow:
        0 1px 3px rgba(20, 22, 40, 0.04),
        0 20px 40px -24px rgba(20, 22, 50, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.85);
}
/* anything further back IS just paper: hidden content, so an exposed
   edge never leaks half a timestamp */
.cd-employee.is-deck .cd-log__card.is-back .cd-log__meta,
.cd-employee.is-deck .cd-log__card.is-back .cd-log__text {
    opacity: 0;
}
.cd-employee.is-deck .cd-log__card.is-back-1 {
    opacity: 0.55;
    z-index: 30;
    transform: translate3d(
            0,
            calc(-1 * (var(--log-card-h) + var(--log-gap)) - 18px),
            0
        )
        scale(0.965);
}
.cd-employee.is-deck .cd-log__card.is-back-2 {
    opacity: 0.32;
    z-index: 25;
    transform: translate3d(
            0,
            calc(-1 * (var(--log-card-h) + var(--log-gap)) - 30px),
            0
        )
        scale(0.95);
}
.cd-employee.is-deck .cd-log__card.is-back-3 {
    opacity: 0.16;
    z-index: 20;
    transform: translate3d(
            0,
            calc(-1 * (var(--log-card-h) + var(--log-gap)) - 38px),
            0
        )
        scale(0.935);
}

@media (max-width: 768px) {
    :root {
        --log-card-h: 178px;
        --log-gap: 12px;
    }
    .cd-log__card {
        padding: 20px 20px 22px;
        gap: 12px;
    }
    .cd-employee.is-deck .cd-log-trail {
        margin-top: 40px;
    }
}
