/* ===========================================================================
   Ratatosk page (.rtp): light page like the rest of the blog; only the app windows (.rt-win, .rt-media, .rt-split) stay dark.
   The first block also colours the Ratatosk card in the apps list (/apps/).
=========================================================================== */
.rtp, .ap-card[data-app="ratatosk"] {
    --iw-teal: #6fbdff; --iw-teal-d: #1f7ae0;
    --rt-mono: "Cascadia Mono", Consolas, "D2Coding", ui-monospace, monospace;
    --rt-bg: #fff; --rt-bg2: #f5f6f8; --rt-bg3: #eceef2; --rt-line: #dfe2e7; --rt-ink: #1f2328; --rt-ink2: #4f5661; --rt-ink3: #7b828c; --rt-acc: #1f7ae0; --rt-head: #111418; --rt-off: #b3b8c0;
}
.rt-win, .rt-media, .rt-split {
    --rt-bg: #1e1e1f; --rt-bg2: #232324; --rt-bg3: #2e2e2f; --rt-line: #3a3a3b; --rt-ink: #e1e1e1; --rt-ink2: #b0b0b0; --rt-ink3: #8a8a8a; --rt-acc: #6fbdff; --rt-head: #fff;
}
.ap-card[data-app="ratatosk"] .ap-tag { color: var(--rt-acc); }
.ap-card[data-app="ratatosk"] .iw-eyebrow span { color: var(--rt-acc); font-family: var(--rt-mono); }

/* coming soon: where IWAE has its download button (also used in the apps list) */
.rt-soon { pointer-events: none; border-style: dashed; border-color: var(--rt-acc); color: var(--rt-ink); }
.rt-soon small { background: var(--rt-bg3); font-family: var(--rt-mono); }

/* ---------- page frame ---------- */
main:has(.rtp) { max-width: none; padding: 0; }
.rtp { background-color: var(--rt-bg); color: var(--rt-ink); line-height: 1.6;
    background-image: radial-gradient(rgba(20, 30, 50, .07) 1px, transparent 1.2px); background-size: 18px 18px; }
.rtp :where(h1, h2, h3, p, ul, ol, figure, pre, table) { margin: 0; padding: 0; }
.rtp ul, .rtp ol { list-style: none; }
.rtp pre, .rtp code { font-family: var(--rt-mono); }
.rt-w { width: min(1040px, calc(100% - 40px)); margin: 0 auto; }
.rt-sec { padding: 72px 0 0; content-visibility: auto; contain-intrinsic-size: auto 700px; }
.rtp h2 { margin-bottom: 14px; font-size: clamp(28px, 4.6vw, 40px); font-weight: 800; line-height: 1.2; letter-spacing: -.035em; color: var(--rt-head); text-wrap: balance; }
.rt-label { margin-bottom: 6px; font: 700 14px var(--rt-mono); letter-spacing: .02em; color: var(--rt-acc); }
.rt-problem { max-width: 62ch; margin-bottom: 28px; font-size: 16.5px; color: var(--rt-ink2); text-wrap: pretty; }
.rt-cap, .rt-idx { font: 12.5px var(--rt-mono); color: var(--rt-ink3); }
.rt-cap { margin-top: 12px; }

/* ---------- hero ---------- */
.rtp { border-radius: 24px; overflow: clip; }
.rt-hero { padding-top: 56px; }
.rt-eyebrow { display: flex; align-items: center; gap: 10px; margin-bottom: 22px; font: 700 13.5px var(--rt-mono); letter-spacing: .02em; color: var(--rt-acc); }
.rt-eyebrow img { width: 30px; height: 30px; }
.rt-hero h1 { font-size: clamp(34px, 6.4vw, 66px); line-height: 1.12; font-weight: 800; letter-spacing: -.035em; color: var(--rt-head); text-wrap: balance; }
.rt-hero h1 em { font: 700 .86em var(--rt-mono); letter-spacing: -.04em; color: var(--rt-acc); font-style: normal;
    background: linear-gradient(transparent 62%, rgba(31, 122, 224, .14) 62% 92%, transparent 92%); }
html[lang="en"] .rt-hero h1 { font-size: clamp(32px, 5.6vw, 58px); }
.rt-lead { max-width: 60ch; margin-top: 22px; font-size: 18px; color: var(--rt-ink2); text-wrap: pretty; }
.rt-chips { display: inline-flex; flex-wrap: wrap; margin-top: 26px; padding: 5px; border-radius: 22px; background: var(--rt-bg3); font: 13.5px var(--rt-mono); color: var(--rt-ink); }
.rt-chips li { padding: 6px 16px; border-radius: 999px; }
.rt-chips li:first-child { background: var(--rt-bg); }
.rt-chips b { margin-right: 9px; font-weight: 400; color: var(--rt-ink3); }
.rt-get { margin: 34px 0 14px; }
.rt-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.rt-btn { display: inline-flex; align-items: center; gap: 10px; height: 46px; padding: 0 18px; border-radius: 10px; background: var(--rt-bg3); color: var(--rt-head); font: 600 15px var(--rt-mono); text-decoration: none; transition: background .2s, transform .2s; }
.rt-btn:hover { background: #e1e4ea; transform: translateY(-1px); }
.rt-btn:active { transform: translateY(1px); }
.rt-btn.main { background: var(--rt-acc); color: #fff; }
.rt-btn.main:hover { background: #3a8cf0; }
.rt-btn small { padding: 2px 8px; border-radius: 99px; background: rgba(255, 255, 255, .2); font: 12.5px var(--rt-mono); }
.rt-dlnote { margin-top: 12px; font: 13.5px var(--rt-mono); color: var(--rt-ink2); }
.rt-ss { margin-top: 4px; font-size: 13px; color: var(--rt-ink3); text-wrap: pretty; }
.rt-end .rt-get { margin: 26px 0 18px; }
.rt-end .rt-get p { margin-top: 10px; font-size: 13px; }
.rt-end .rt-get .rt-ss { margin-top: 4px; }

/* window frames: terminal and app screenshot */
.rt-win { margin-top: 14px; color: var(--rt-ink); overflow: hidden; border-radius: 12px; background: var(--rt-bg2); box-shadow: 0 0 0 1px var(--rt-line), 0 18px 40px -24px rgba(20, 30, 50, .45); }
.rt-win img { display: block; width: 100%; height: auto; }
.rt-bar { display: flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; background: var(--rt-bg3); font: 12.5px var(--rt-mono); color: var(--rt-ink3); }
.rt-bar i { width: 11px; height: 11px; border-radius: 50%; background: #5a5a5b; }
.rt-bar span { flex: 1; margin-right: 40px; text-align: center; }
.rt-term pre { padding: 18px 20px; font-size: 14px; line-height: 1.8; color: var(--rt-ink); overflow-x: auto; }
.rt-term pre span { display: block; min-height: 1.8em; white-space: pre-wrap; overflow-wrap: anywhere; }
.rt-term .c, .rt-code .c { color: var(--rt-ink3); }
.rt-term .p::before, .rt-ver .p::before { content: "$ "; color: var(--rt-acc); }

/* ---------- 01 flow ---------- */
.rt-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--rt-line); border-bottom: 1px solid var(--rt-line); }
.rt-steps li { padding: 22px 22px 26px 0; }
.rt-steps li + li { padding-left: 22px; border-left: 1px solid var(--rt-line); }
.rt-steps code { font-size: 13px; color: var(--rt-acc); }
.rt-steps h3 { margin: 10px 0 6px; font-size: 20px; font-weight: 800; letter-spacing: -.02em; color: var(--rt-head); }
.rt-steps p { font-size: 15px; color: var(--rt-ink2); }

/* ---------- 02 ruled feature grid ---------- */
.rt-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; border: 1px solid var(--rt-line); border-radius: 14px; overflow: hidden; background: var(--rt-line); }
.rt-cell { display: flex; flex-direction: column; gap: 18px; padding: 24px; background: var(--rt-bg); min-width: 0; content-visibility: auto; contain-intrinsic-size: auto 480px; }
.rt-cell.wide { grid-column: 1 / -1; }
.rt-tc h3 { margin: 6px 0 8px; font-size: 20px; font-weight: 800; line-height: 1.3; letter-spacing: -.02em; color: var(--rt-head); }
.rt-tc p:not(.rt-idx) { font-size: 15px; color: var(--rt-ink2); text-wrap: pretty; }
.rt-ms { display: flex; flex-direction: column; gap: 12px; margin-top: auto; }
.rt-cell.wide .rt-ms { flex-direction: row; }
.rt-cell.wide .rt-ms > * { flex: 1; min-width: 0; }
.rt-media { aspect-ratio: var(--ar); overflow: hidden; border-radius: 8px; background: var(--rt-bg3); box-shadow: 0 0 0 1px rgba(255, 255, 255, .08); }
.rt-media img, .rt-media video { display: block; width: 100%; height: 100%; object-fit: cover; }
.rt-code { display: flex; flex-direction: column; justify-content: center; height: 100%; box-sizing: border-box; padding: 18px; font-size: 13.5px; line-height: 1.8; color: var(--rt-ink); overflow-x: auto; background: var(--rt-bg2); }
.rt-code span { white-space: pre; }

/* ---------- 03 comparison ---------- */
.rt-table { width: 100%; border-collapse: collapse; font-size: 15.5px; }
.rt-table th, .rt-table td { padding: 14px 12px; border-top: 1px solid var(--rt-line); text-align: left; }
.rt-table tbody tr:last-child > * { border-bottom: 1px solid var(--rt-line); }
.rt-table thead th { border-top: 0; font: 600 13px var(--rt-mono); color: var(--rt-ink3); text-align: center; }
.rt-table thead th.me { color: var(--rt-acc); }
.rt-table tbody th { padding-left: 0; font-weight: 500; color: var(--rt-ink); }
.rt-table td { width: 22%; text-align: center; font: 700 17px var(--rt-mono); }
.rt-table td.y { color: var(--rt-ink2); } .rt-table td.n { color: var(--rt-off); }
.rt-table td.me { background: rgba(31, 122, 224, .07); color: var(--rt-acc); }
.rt-table td.n.me { color: var(--rt-off); }

/* ---------- 04 architecture ---------- */
.rt-arch { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 36px; align-items: start; }
.rt-diagram { margin-top: 0; padding-bottom: 20px; }
.rt-diagram > .rt-box, .rt-diagram > .rt-wire { margin: 18px 20px 0; }
.rt-box { display: flex; flex-direction: column; gap: 4px; padding: 16px 18px; border-radius: 8px; background: var(--rt-bg3); }
.rt-box b { font-size: 19px; font-weight: 800; color: var(--rt-head); }
.rt-box span { font-size: 13.5px; color: var(--rt-ink2); }
.rt-box code { font-size: 14px; color: var(--rt-acc); }
.rt-wire { display: flex; flex-direction: column; align-items: center; font: 12px var(--rt-mono); color: var(--rt-acc); }
.rt-wire .ln { width: 0; height: 12px; border-left: 1px dashed var(--rt-acc); }
.rt-wire .wl { display: flex; flex-direction: column; align-items: center; padding: 4px 0; text-align: center; }
.rt-wire .wl b { font-size: 14px; }
.rt-wire .wl small { color: var(--rt-ink2); font-size: 12.5px; }
.rt-points li { padding: 10px 0; border-bottom: 1px solid var(--rt-line); font-size: 15.5px; }
.rt-points li:first-child { padding-top: 0; }
.rt-points li::before { content: "+ "; font-family: var(--rt-mono); color: var(--rt-acc); }
.rt-note { margin-top: 18px; font: 13.5px/1.7 var(--rt-mono); color: var(--rt-ink3); text-wrap: pretty; }

/* ---------- 05 themes ---------- */
.rt-split { display: grid; overflow: hidden; border-radius: 12px; box-shadow: 0 0 0 1px var(--rt-line); }
.rt-split img { grid-area: 1 / 1; display: block; width: 100%; height: auto; }
.rt-split img + img { clip-path: inset(0 0 0 50%); }

/* ---------- 06 tech ---------- */
.rt-tech { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--rt-line); }
.rt-tech li { padding: 22px 24px 26px 0; border-bottom: 1px solid var(--rt-line); }
.rt-tech li:nth-child(even) { padding-left: 24px; border-left: 1px solid var(--rt-line); }
.rt-tech h3 { margin: 6px 0 6px; font: 700 17px var(--rt-mono); letter-spacing: -.02em; color: var(--rt-head); }
.rt-tech li p:not(.rt-idx) { font-size: 15px; color: var(--rt-ink2); text-wrap: pretty; }

/* ---------- ending ---------- */
.rt-end { padding: 88px 0 96px; }
.rt-end img { width: 64px; height: 64px; }
.rt-ver { margin: 22px 0 22px; font-size: 15px; line-height: 1.9; color: var(--rt-ink2); }
.rt-ver .k { color: var(--rt-acc); font-weight: 700; }
.rt-end h2 { font-size: clamp(30px, 5vw, 48px); font-weight: 800; letter-spacing: -.035em; color: var(--rt-head); }
.rt-end p { max-width: none; margin-top: 10px; font-size: 16.5px; color: var(--rt-ink2); }
.rt-end .rt-fine { font: 13px var(--rt-mono); color: var(--rt-ink3); }

@media (max-width: 700px) {
    .rt-steps, .rt-tech, .rt-arch { grid-template-columns: minmax(0, 1fr); }
    .rt-steps li + li { padding-left: 0; border-left: 0; border-top: 1px solid var(--rt-line); }
    .rt-tech li:nth-child(even) { padding-left: 0; border-left: 0; }
    .rt-arch { gap: 24px; }
}
@media (max-width: 640px) {
    .rt-sec { padding-top: 56px; }
    .rt-grid { grid-template-columns: minmax(0, 1fr); }
    .rt-cell.wide .rt-ms { flex-direction: column; }
    .rt-cell { padding: 20px 16px; }
    .rt-table { font-size: 14px; } .rt-table td { width: 18%; }
    .rt-term pre { font-size: 12.5px; }
}
@media (max-width: 520px) { .rt-chips { display: flex; flex-direction: column; border-radius: 16px; } .rt-chips li { border-radius: 12px; } }
.ap-card[data-app="ratatosk"] .iw-btn-main { background: #1f7ae0; border-color: #1f7ae0; color: #fff; box-shadow: none; }
.ap-card[data-app="ratatosk"] .iw-btn-main:hover { background: #3a8cf0; border-color: #3a8cf0; color: #fff; }
