/* ══════════════════════════════════════════════════════════════════════════
   publicne.ws — The Room (operators page)
   Page-specific styles. Loads after tokens + base + components.
   ══════════════════════════════════════════════════════════════════════════ */

/* ─── Hero ─────────────────────────────────────────────────────────── */
.hero {
    padding: calc(max(88px, 14vh) + env(safe-area-inset-top)) 0 var(--s-6);
    position: relative;
}
.hero__shell {
    display: grid;
    gap: var(--s-8);
}

.hero__tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: var(--f-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--fg-muted);
}
.hero__tag b {
    color: var(--red);
    font-weight: 600;
}
.hero__tag .sep {
    color: var(--line-2);
}

.hero__title {
    font-family: var(--f-display);
    font-weight: 800;
    font-size: var(--fs-hero);
    line-height: 0.82;
    letter-spacing: -0.055em;
    margin: 0;
    text-wrap: balance;
}
.hero__title .line {
    display: block;
    overflow: hidden;
    padding-bottom: 0.04em;
}
.hero__title .line > span {
    display: inline-block;
    transform: translateY(101%);
    animation: rise 900ms var(--ease) forwards;
}
.hero__title .line:nth-child(2) > span {
    animation-delay: 130ms;
}
.hero__title .red {
    color: var(--red);
}
.hero__title .slash {
    color: var(--red);
    font-weight: 400;
    display: inline-block;
    transform: translateY(-0.06em);
    padding: 0 0.04em;
}

@keyframes rise {
    to {
        transform: translateY(0);
    }
}

.hero__deck {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-5) var(--s-8);
    padding-top: var(--s-5);
    border-top: 1px solid var(--line);
    opacity: 0;
    animation: fadeIn 700ms var(--ease) 500ms forwards;
}
@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.hero__deck p {
    margin: 0;
    font-size: var(--fs-lg);
    line-height: 1.35;
    max-width: 44ch;
    text-wrap: pretty;
    color: var(--fg);
}
.hero__deck p b {
    color: var(--red);
    font-weight: 500;
}

.hero__deck .meta {
    font-family: var(--f-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--fg-muted);
    align-self: end;
    display: grid;
    gap: 4px;
}
.hero__deck .meta span {
    display: block;
}
.hero__deck .meta b {
    color: var(--fg);
    font-weight: 500;
}

@media (min-width: 900px) {
    .hero__deck {
        grid-template-columns: 1fr auto;
        align-items: end;
    }
}

/* ─── Sections ─────────────────────────────────────────────────────── */
.section {
    padding: var(--s-12) 0;
    position: relative;
}
.section--tight {
    padding: var(--s-10) 0;
}

/* ─── Pipeline schema (SVG diagram) ────────────────────────────────── */
.schema__wrap {
    position: relative;
    padding: var(--s-6) 0;
    border: 1px solid var(--line);
    background: var(--bg-2);
    overflow: hidden;
}
.schema__grid {
    position: absolute;
    inset: 0;
    background-image: linear-gradient(
        to right,
        color-mix(in oklab, var(--fg) 5%, transparent) 1px,
        transparent 1px
    );
    background-size: 48px 48px;
    pointer-events: none;
    opacity: 0.6;
}
.schema__scroll {
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    position: relative;
    padding: var(--s-5) var(--gutter);
}
.schema__scroll::-webkit-scrollbar {
    height: 4px;
}
.schema__scroll::-webkit-scrollbar-thumb {
    background: var(--line-2);
    border-radius: 2px;
}

.schema svg {
    display: block;
    min-width: 1080px;
    width: 100%;
    height: auto;
    max-width: 1400px;
    margin: 0 auto;
}
.schema svg .node-rect {
    fill: var(--bg);
    stroke: var(--fg);
    stroke-width: 1.5;
    transition: fill 300ms var(--ease);
}
.schema svg .node-rect:hover {
    fill: var(--red-ghost);
}
.schema svg .node-label {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: 16px;
    fill: var(--fg);
    letter-spacing: -0.01em;
}
.schema svg .node-id {
    font-family: var(--f-mono);
    font-size: 10px;
    fill: var(--red);
    letter-spacing: 0.08em;
    font-weight: 500;
}
.schema svg .node-type {
    font-family: var(--f-mono);
    font-size: 9px;
    fill: var(--fg-muted);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
.schema svg .arrow {
    stroke: var(--fg);
    stroke-width: 1.2;
    fill: none;
}
.schema svg .arrow-label {
    font-family: var(--f-mono);
    font-size: 9px;
    fill: var(--fg-muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.schema svg .loop {
    stroke: var(--red);
    stroke-width: 1.2;
    fill: none;
    stroke-dasharray: 4 3;
}
.schema svg .loop-label {
    font-family: var(--f-mono);
    font-size: 9px;
    fill: var(--red);
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.schema svg .human-rect {
    fill: var(--fg);
    stroke: var(--fg);
}
.schema svg .human-label {
    fill: var(--bg);
}
.schema svg .human-id {
    fill: var(--red-hi);
}
.schema svg .human-type {
    fill: color-mix(in oklab, var(--bg) 60%, transparent);
}
.schema svg .oversight {
    stroke: var(--fg-muted);
    stroke-width: 1;
    fill: none;
    stroke-dasharray: 2 3;
    opacity: 0.6;
}

.schema__legend {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-5);
    margin-top: var(--s-4);
    padding: var(--s-3) var(--s-4);
    border-top: 1px solid var(--line);
    font-family: var(--f-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--fg-muted);
}
.schema__legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
}
.schema__legend-item b {
    color: var(--fg);
    font-weight: 500;
}
.schema__legend-line {
    width: 24px;
    height: 2px;
    background: var(--fg);
}
.schema__legend-line.dashed {
    background: transparent;
    border-top: 1.5px dashed var(--red);
    height: 0;
}
.schema__legend-line.dotted {
    background: transparent;
    border-top: 1.5px dotted var(--fg-muted);
    height: 0;
}

/* ─── Roster (operator cards) ──────────────────────────────────────── */
.roster {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

.card {
    padding: var(--s-8) 0;
    border-bottom: 1px solid var(--line);
    position: relative;
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-4);
    cursor: default;
    opacity: 0;
    transform: translateY(20px);
    transition:
        background 400ms var(--ease),
        opacity 700ms var(--ease),
        transform 700ms var(--ease);
}
.card.in {
    opacity: 1;
    transform: translateY(0);
}
.card::before {
    content: "";
    position: absolute;
    left: calc(-1 * var(--gutter));
    right: calc(-1 * var(--gutter));
    top: 0;
    bottom: 0;
    background: var(--red-ghost);
    opacity: 0;
    transform: scaleX(0);
    transform-origin: left center;
    transition:
        transform 500ms var(--ease),
        opacity 300ms var(--ease);
    z-index: -1;
}
.card:hover::before {
    opacity: 1;
    transform: scaleX(1);
}
.card:hover .card__index {
    color: var(--red);
}
.card:hover .card__mark::after {
    transform: scaleX(1);
}

.card__top {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--s-4);
    flex-wrap: wrap;
    padding-bottom: var(--s-2);
}
.card__index {
    font-family: var(--f-mono);
    font-size: var(--fs-sm);
    font-weight: 600;
    letter-spacing: 0.1em;
    color: var(--fg-muted);
    transition: color 250ms var(--ease);
}
.card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

.card__mark {
    margin: 0;
    font-family: var(--f-display);
    font-weight: 800;
    font-size: var(--fs-name);
    line-height: 0.88;
    letter-spacing: -0.055em;
    color: var(--fg);
    position: relative;
    display: inline-block;
}
.card__mark::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0.06em;
    height: 2px;
    width: 100%;
    background: var(--red);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 600ms var(--ease);
}
.card:nth-child(even) .card__mark {
    padding-left: clamp(0px, 4vw, 64px);
}
.card:nth-child(3n) .card__mark {
    padding-left: clamp(0px, 8vw, 120px);
}

.card__body {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-5);
    padding-top: var(--s-3);
    border-top: 1px solid var(--line);
}
.card__desc {
    margin: 0;
    font-family: var(--f-display);
    font-weight: 400;
    font-size: var(--fs-lg);
    line-height: 1.3;
    max-width: 48ch;
    text-wrap: pretty;
}
.card__desc b {
    color: var(--red);
    font-weight: 500;
}

.card__stats {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
    font-family: var(--f-mono);
    font-size: var(--fs-sm);
    background: var(--bg);
    border: 1px solid var(--line);
    padding: 2px;
}
.card__stat {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: baseline;
    gap: var(--s-3);
    padding: 8px 12px;
    border-bottom: 1px dashed var(--line);
}
.card__stat:last-child {
    border-bottom: 0;
}
.card__stat span {
    color: var(--fg-muted);
    font-size: var(--fs-xs);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.card__stat b {
    color: var(--fg);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    transition: opacity 200ms var(--ease);
    text-align: right;
}
.card__stat b em {
    color: var(--red);
    font-style: normal;
    font-weight: 600;
}

@media (min-width: 760px) {
    .card__body {
        grid-template-columns: 1.3fr 1fr;
        gap: var(--s-8);
        align-items: start;
    }
    .card {
        padding: var(--s-10) 0;
    }
}

/* ─── Editor-in-Chief (full-bleed ink) ─────────────────────────────── */
.editor {
    background: var(--ink);
    color: oklch(96% 0.003 100);
    margin: var(--s-10) 0 0;
    padding: var(--s-12) 0;
    position: relative;
    overflow: hidden;
}
[data-theme="dark"] .editor {
    background: var(--ink-soft);
}

.editor::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: linear-gradient(
        to right,
        color-mix(in oklab, #fff 6%, transparent) 1px,
        transparent 1px
    );
    background-size: 48px 100%;
    opacity: 0.4;
    pointer-events: none;
}

.editor__plate {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: var(--s-3);
    padding-bottom: var(--s-3);
    border-bottom: 1px solid color-mix(in oklab, #fff 20%, transparent);
    font-family: var(--f-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.75;
    position: relative;
}
.editor__plate b {
    color: var(--red-hi);
    font-weight: 600;
}

.editor__title {
    margin: var(--s-8) 0;
    font-family: var(--f-display);
    font-weight: 800;
    font-size: clamp(3.5rem, 12vw, 10rem);
    line-height: 0.82;
    letter-spacing: -0.055em;
    text-wrap: balance;
    position: relative;
}
.editor__title .red {
    color: var(--red-hi);
}

.editor__grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--s-8);
    position: relative;
}

.editor__memo {
    display: grid;
    gap: var(--s-5);
}

.editor__lede {
    margin: 0;
    font-family: var(--f-display);
    font-size: clamp(1.25rem, 2vw + 0.5rem, 1.75rem);
    font-weight: 400;
    line-height: 1.3;
    max-width: 52ch;
    text-wrap: pretty;
}
.editor__lede b {
    color: var(--red-hi);
    font-weight: 500;
}

.editor__sig {
    display: grid;
    gap: var(--s-2);
    padding: var(--s-5) 0;
    border-top: 1px solid color-mix(in oklab, #fff 20%, transparent);
    border-bottom: 1px solid color-mix(in oklab, #fff 20%, transparent);
    max-width: 360px;
}
.editor__sig-line {
    width: 200px;
    height: 2px;
    background: oklch(96% 0.003 100);
    margin-bottom: var(--s-2);
}
.editor__sig-label {
    font-family: var(--f-mono);
    font-size: var(--fs-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.7;
    line-height: 1.6;
}
.editor__sig-label b {
    color: oklch(96% 0.003 100);
    opacity: 1;
    font-weight: 600;
}

.editor__auth {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1px;
    background: color-mix(in oklab, #fff 15%, transparent);
    border: 1px solid color-mix(in oklab, #fff 15%, transparent);
}
.editor__auth-item {
    background: var(--ink);
    padding: var(--s-4) var(--s-5);
    display: grid;
    gap: 4px;
    transition: background 260ms var(--ease);
}
[data-theme="dark"] .editor__auth-item {
    background: var(--ink-soft);
}
.editor__auth-item:hover {
    background: color-mix(in oklab, var(--red) 18%, var(--ink));
}
.editor__auth-item span {
    font-family: var(--f-mono);
    font-size: 0.65rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.65;
}
.editor__auth-item b {
    font-family: var(--f-display);
    font-weight: 700;
    font-size: var(--fs-md);
    letter-spacing: -0.015em;
}

@media (min-width: 900px) {
    .editor__grid {
        grid-template-columns: 1.2fr 1fr;
        gap: var(--s-10);
        align-items: start;
    }
    .editor__auth {
        grid-template-columns: 1fr 1fr;
    }
}

/* ─── House rules ─────────────────────────────────────────────────── */
.rules__list {
    list-style: none;
    padding: 0;
    margin: 0;
    border-top: 1px solid var(--line);
}
.rules__item {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--s-5);
    align-items: center;
    padding: var(--s-6) 0;
    border-bottom: 1px solid var(--line);
    transition:
        padding-left 400ms var(--ease),
        background 300ms var(--ease);
    position: relative;
}
.rules__item:hover {
    background: var(--bg-2);
    padding-left: var(--s-3);
}
.rules__num {
    font-family: var(--f-mono);
    font-size: var(--fs-sm);
    color: var(--red);
    font-weight: 600;
    letter-spacing: 0.06em;
    line-height: 1;
    align-self: start;
    padding-top: 0.6em;
    min-width: 3ch;
}
.rules__text {
    margin: 0;
    font-family: var(--f-display);
    font-weight: 700;
    font-size: clamp(1.25rem, 3vw + 0.2rem, 2.25rem);
    line-height: 1.1;
    letter-spacing: -0.025em;
    max-width: 32ch;
    text-wrap: balance;
}
.rules__text b {
    color: var(--red);
    font-weight: 700;
}

@media (min-width: 760px) {
    .rules__item {
        grid-template-columns: 100px 1fr;
        gap: var(--s-8);
        padding: var(--s-8) 0;
    }
    .rules__num {
        font-size: var(--fs-md);
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .card {
        opacity: 1;
        transform: none;
    }
    .hero__title .line > span {
        transform: none;
    }
    .hero__deck {
        opacity: 1;
    }
}
