/* pages.css - styles for the server-rendered pages (story, day, tracker, follow). */

:root {
    --bg: #f6f7f9;
    --card: #ffffff;
    --text: #14181d;
    --muted: #5b6672;
    --meta: #626c78;
    --link: #0b5fa5;
    --border: #dde2e8;
    --accent: #0369a1;
    --focus: #b45309;
    --news: #0369a1;
    --security: #b91c1c;
    --paywall: #92400e;
    --paywall-bg: #fef3c7;
    --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

html.dark {
    --bg: #0f1318;
    --card: #151a21;
    --text: #e6eaef;
    --muted: #a3adb8;
    --meta: #8d98a4;
    --link: #7dd3fc;
    --border: #242b34;
    --accent: #7dd3fc;
    --focus: #fbbf24;
    --news: #7dd3fc;
    --security: #f87171;
    --paywall: #fcd34d;
    --paywall-bg: #3b2f0b;
}

[hidden] {
    display: none !important;
}

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

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

body {
    margin: 0;
    font: 15px/1.45 var(--font);
    background: var(--bg);
    color: var(--text);
    overflow-wrap: anywhere;
}

a {
    color: var(--link);
}

a:hover {
    text-decoration: underline;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
main:focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 2px;
}

main:focus {
    outline: none;
}

.px-skip {
    position: absolute;
    left: 8px;
    top: -60px;
    z-index: 20;
    padding: 8px 12px;
    background: var(--text);
    color: var(--bg);
    font-size: 13px;
}

.px-skip:focus {
    top: 8px;
}

.px-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Main and footer */

.px-footer {
    border-top: 1px solid var(--border);
    font-size: 12px;
}

.px-footer-inner {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    width: min(85%, 1180px);
    margin: 0 auto;
    padding: 16px;
}

.px-footer a {
    color: var(--muted);
}

/* Type */

h1 {
    margin: 8px 0;
    font-size: 22px;
    line-height: 1.25;
    font-weight: 700;
}

h2 {
    margin: 24px 0 8px;
    font-size: 16px;
    font-weight: 700;
}

h3 {
    margin: 16px 0 4px;
    font-size: 14px;
    font-weight: 700;
}

p {
    margin: 8px 0;
}

.px-lead {
    font-size: 16px;
    line-height: 1.55;
    margin: 0 0 6px;
}

h2.px-h2--first {
    margin-top: 14px;
}

.px-intro {
    color: var(--muted);
    font-size: 13px;
}

.px-note {
    color: var(--muted);
    font-size: 12px;
}

.px-breadcrumb {
    color: var(--muted);
    font-size: 12px;
}

.px-breadcrumb a {
    color: var(--muted);
}

/* Lists and rows */

.px-list,
.px-labs,
.px-plain {
    margin: 0;
    padding: 0;
    list-style: none;
}

.px-plain li,
.px-labs li {
    margin: 4px 0;
}

.px-labs li {
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
    font-size: 13px;
}

.px-row {
    padding: 9px 0 9px 12px;
    border-left: 3px solid var(--news);
    border-bottom: 1px solid var(--border);
}

.px-row--security {
    border-left-color: var(--security);
}

.px-row-title {
    margin: 0;
    font-size: 15px;
    font-weight: 400;
}

.px-row-title a {
    color: var(--text);
    text-decoration: none;
}

.px-row-title a:hover {
    text-decoration: underline;
}

.px-row-title a:visited {
    color: var(--muted);
}

.px-row-summary {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 3px 0;
    font-size: 13px;
    color: var(--muted);
}

.px-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 8px;
    margin: 3px 0 0;
    font-size: 11px;
    color: var(--meta);
}

.px-kicker {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    color: var(--news);
}

.px-kicker--security {
    color: var(--security);
}

p.px-kicker {
    margin: 12px 0 0;
}

.px-paywall {
    padding: 0 5px;
    border: 1px solid currentColor;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--paywall);
    background: var(--paywall-bg);
}

.px-tag {
    font-weight: 700;
}

/* Buttons, chips, forms */

.px-btn {
    display: inline-block;
    padding: 8px 14px;
    border: 1px solid var(--text);
    border-radius: 0;
    background: var(--text);
    color: var(--bg);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: none;
    cursor: pointer;
}

.px-btn:hover {
    text-decoration: underline;
    color: var(--bg);
}

.px-btn--ghost {
    background: transparent;
    border-color: var(--border);
    color: var(--text);
}

.px-btn--ghost:hover {
    color: var(--text);
}

.px-links {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.px-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 12px 0;
}

.px-chip {
    padding: 4px 10px;
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    text-decoration: none;
}

.px-chip:hover {
    border-color: var(--text);
    text-decoration: none;
}

.px-chip.is-on {
    background: var(--text);
    border-color: var(--text);
    color: var(--bg);
}

.px-copy-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.px-input {
    flex: 1 1 200px;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid var(--border);
    border-radius: 0;
    background: var(--card);
    color: var(--text);
    font: inherit;
    font-size: 13px;
}

.px-code {
    margin: 8px 0;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--card);
    font: 13px/1.5 Consolas, Menlo, monospace;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

/* Inline code and the agent test table. */
.px-col code {
    padding: 1px 4px;
    border: 1px solid var(--border);
    background: var(--card);
    font: 13px Consolas, Menlo, monospace;
    overflow-wrap: anywhere;
}

.px-table-wrap {
    margin: 8px 0 16px;
    overflow-x: auto;
    border: 1px solid var(--border);
    background: var(--card);
}

.px-table {
    width: 100%;
    min-width: 640px;
    border-collapse: collapse;
    font-size: 13px;
}

.px-table th,
.px-table td {
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: top;
}

.px-table th {
    color: var(--text);
    background: var(--bg);
    white-space: nowrap;
}

.px-table tr:last-child td {
    border-bottom: 0;
}

.px-table td:first-child,
.px-table td code {
    white-space: nowrap;
}

/* Story page */

.px-story-hero {
    max-width: 760px;
    margin: 16px 0;
    aspect-ratio: 16 / 9;
    background: var(--border);
}

.px-story-hero img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.px-facts {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 6px 16px;
    margin: 8px 0;
    font-size: 13px;
}

.px-facts dt {
    color: var(--muted);
}

.px-facts dd {
    margin: 0;
}

.px-brief {
    margin: 16px 0;
    padding: 4px 12px 8px;
    border: 1px solid var(--border);
    background: var(--card);
}

.px-brief h2 {
    margin-top: 12px;
}

/* Small screens */

@media (max-width: 700px) {
    .px-footer-inner {
        width: 100%;
        padding: 16px 12px;
    }
}

@media (max-width: 480px) {
    h1 {
        font-size: 20px;
    }

    .px-facts {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .px-facts dd {
        margin-bottom: 8px;
    }

    .px-btn {
        flex: 1 1 auto;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important;
        animation: none !important;
    }
}

/* Story page: summary card with a small picture on the right. */
.px-summary {
    margin: 14px 0 6px;
    padding: 16px 18px;
    background: var(--card);
    border: 1px solid var(--border);
}

.px-summary--pic {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 20px;
    align-items: start;
}

.px-summary .px-h2--first {
    margin-top: 0;
}

.px-summary .px-links {
    margin: 12px 0 0;
}

.px-story-thumb {
    aspect-ratio: 16 / 9;
    background: var(--border);
    border: 1px solid var(--border);
}

.px-story-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.px-story-thumb[hidden] {
    display: none;
}

@media (max-width: 599px) {
    .px-summary--pic {
        grid-template-columns: minmax(0, 1fr);
    }

    .px-story-thumb {
        order: -1;
        max-width: 100%;
    }
}

/* ==========================================================================
   2026-11-19 quality pass: the same frame, cards, and calm type as the home
   page. Restraint over decoration: small labels, no underlines until hover,
   one accent color, one card style.
   ========================================================================== */

:root {
    --text-strong: #0f1419;
    --navy: #08233f;
}

html.dark {
    --text-strong: #f1f4f7;
    --navy: #7dd3fc;
}

body {
    font-size: 14px;
    line-height: 1.5;
}

a,
a:visited {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* The footer shares the 1120px frame. */
.px-footer-inner {
    width: min(100% - 32px, 1120px);
    max-width: none;
    padding-left: 0;
    padding-right: 0;
}

/* Type */
h1 {
    margin: 4px 0 6px;
    color: var(--text-strong);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

/* Section headings read as quiet labels, as on Reddit and Hacker News. */
h2,
h2.px-h2--first {
    margin: 26px 0 10px;
    color: var(--meta);
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.px-summary h2.px-h2--first {
    margin: 0 0 8px;
}

.px-intro,
.px-plain,
.px-note {
    color: var(--muted);
    font-size: 13px;
}

.px-breadcrumb,
.px-breadcrumb a,
.px-breadcrumb a:visited {
    color: var(--meta);
    font-size: 12px;
}

.px-kicker {
    font-size: 10.5px;
    letter-spacing: 0.06em;
}

/* Rows are cards with the same structure as the home feed. */
.px-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.px-row {
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--news);
}

.px-row--security {
    border-left-color: var(--security);
}

.px-row-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 2px 10px;
    margin: 0 0 4px;
    color: var(--meta);
    font-size: 11px;
}

.px-row-meta .px-more,
.px-row-meta .px-more:visited,
.px-row-meta a,
.px-row-meta a:visited {
    color: var(--meta);
    text-decoration: underline;
    text-decoration-color: color-mix(in srgb, var(--meta) 40%, transparent);
    text-underline-offset: 2px;
}

.px-row-meta a:hover {
    color: var(--text);
    text-decoration-color: currentColor;
}

.px-source {
    color: var(--text);
    font-weight: 600;
}

.px-row-title {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
}

.px-row-title a,
.px-row-title a:visited {
    color: var(--text-strong);
}

.px-row-summary {
    margin: 4px 0 0;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

/* Buttons: one solid style, one quiet style. */
.px-btn,
.px-btn:visited {
    padding: 8px 14px;
    color: #ffffff;
    background: var(--navy);
    border: 1px solid var(--navy);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
}

html.dark .px-btn,
html.dark .px-btn:visited {
    color: #04121f;
}

.px-btn:hover {
    text-decoration: none;
    filter: brightness(1.15);
}

.px-btn--ghost,
.px-btn--ghost:visited {
    color: var(--text);
    background: var(--card);
    border-color: var(--border);
}

html.dark .px-btn--ghost,
html.dark .px-btn--ghost:visited {
    color: var(--text);
}

.px-btn--ghost:hover {
    filter: none;
    border-color: var(--muted);
}

/* "Brief me in" is one quiet line of text links. */
.px-brief {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    margin: 12px 0 4px;
    padding: 0;
    background: none;
    border: 0;
    font-size: 12.5px;
}

.px-brief-label {
    color: var(--meta);
}

.px-brief a,
.px-brief a:visited {
    color: var(--link);
    font-weight: 600;
}

.px-brief-copy {
    padding: 0;
    color: var(--meta);
    background: none;
    border: 0;
    font: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    cursor: pointer;
}

.px-brief-copy:hover {
    color: var(--text);
}

/* Filter chips match the home filter buttons. */
.px-chips {
    gap: 6px;
}

.px-chip,
.px-chip:visited {
    padding: 5px 10px;
    color: var(--text);
    background: var(--card);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
}

.px-chip:hover {
    border-color: var(--muted);
    text-decoration: none;
}

.px-chip.is-on,
.px-chip.is-on:visited {
    color: #ffffff;
    background: var(--navy);
    border-color: var(--navy);
}

html.dark .px-chip.is-on {
    color: #04121f;
}

/* Story page parts. */
.px-summary {
    border-left: 3px solid var(--news);
}

.px-lead {
    color: var(--text-strong);
    font-size: 16px;
    line-height: 1.6;
}

.px-facts {
    padding: 12px 16px;
    background: var(--card);
    border: 1px solid var(--border);
}

/* Footer: quiet links, no underlines. */
.px-footer {
    margin-top: 8px;
}

.px-footer-inner a,
.px-footer-inner a:visited {
    color: var(--meta);
    text-decoration: none;
}

.px-footer-inner a:hover {
    color: var(--text);
    text-decoration: underline;
}

@media (max-width: 599px) {
    .px-footer-inner {
        width: calc(100% - 24px);
    }

    .px-row {
        padding: 11px 12px;
    }

    h1 {
        font-size: 20px;
    }
}

.px-summary--security {
    border-left-color: var(--security);
}

/* Lighter filter chips: many types fit in fewer rows. */
.px-chips {
    gap: 4px 6px;
}

.px-chip,
.px-chip:visited {
    padding: 3px 8px;
    font-size: 11.5px;
    font-weight: 500;
}

/* System font tuning. */
body {
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1 {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.015em;
}

.px-row-title {
    font-size: 16px;
    font-weight: 600;
}

.px-row-summary,
.px-intro,
.px-plain,
.px-note {
    font-size: 14px;
}

.px-lead {
    font-size: 17px;
}

.px-row-meta {
    font-size: 12px;
}

@media (max-width: 599px) {
    h1 {
        font-size: 22px;
    }

    .px-row-title {
        font-size: 15.5px;
    }
}

/* ------------------------------------------------------------------
   One frame for every page (2026-11-19). The header, page column and
   side column are in site-frame.css; the footer matches the app pages.
   ------------------------------------------------------------------ */

.px-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Column: width and side padding come from .dx-frame in site-frame.css, the
   same frame as the header and the home page. Set only vertical spacing here. */
.px-main {
    padding-top: 12px;
    padding-bottom: 46px;
}

.px-more {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    margin-top: 28px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
}

.px-more a,
.px-more a:visited {
    color: var(--meta);
    text-decoration: none;
}

.px-more a:hover {
    color: var(--text);
    text-decoration: underline;
}

/* Footer: the fixed bar of the app. */
.px-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    justify-content: center;
    height: 32px;
    margin: 0;
    padding: 0 16px;
    box-sizing: border-box;
    background: #08233f;
    border-top: 2px solid #0369a1;
    color: #e6eef5;
    font-size: 12px;
}

.px-footer-inner {
    position: relative;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: 100%;
    max-width: min(85%, 1180px);
    height: 30px;
    margin: 0;
    padding: 0;
}

.px-footer-pair {
    display: flex;
    height: 30px;
}

.px-footer-pair a,
.px-footer-pair a:visited,
.px-footer-rss,
.px-footer-rss:visited {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    height: 30px;
    color: #ffffff;
    font-weight: 700;
    text-decoration: none;
}

.px-footer-pair a:hover,
.px-footer-rss:hover {
    color: #7dd3fc;
    text-decoration: none;
}

.px-footer-rss {
    position: absolute;
    right: 0;
    top: 0;
}

.px-footer-rss svg {
    color: #f59e0b;
}

.px-visitor {
    position: absolute;
    left: 0;
    top: 0;
    display: flex;
    align-items: center;
    gap: 6px;
    height: 30px;
    color: #e6eef5;
    white-space: nowrap;
}

.px-visitor[hidden] {
    display: none;
}

.px-visitor-label,
.px-visitor-ago {
    color: #9fb3c8;
}

.px-visitor b {
    color: #ffffff;
    font-weight: 700;
}

.px-footer a:focus-visible {
    outline: 2px solid #fbbf24;
    outline-offset: -2px;
}

@media (max-width: 700px) {
    .px-footer-inner {
        max-width: none;
    }

    .px-visitor-label {
        display: none;
    }
}

/* The older footer link rules are more specific; restate the bar colors. */
.px-footer .px-footer-pair a,
.px-footer .px-footer-pair a:visited,
.px-footer .px-footer-rss,
.px-footer .px-footer-rss:visited {
    color: #ffffff;
    text-decoration: none;
}

.px-footer .px-footer-pair a:hover,
.px-footer .px-footer-rss:hover {
    color: #7dd3fc;
    text-decoration: none;
}

.px-footer .px-footer-rss {
    padding: 0 10px;
}

@media (max-width: 760px) {
    .px-footer-rss span {
        display: none;
    }
}
