/* Markdown Prism — site styles
 *
 * The palette and the type pairing come from the app itself: the blue it draws
 * headings and links in, the orange its editor gives list markers, the grey its
 * code blocks sit on, and the two faces it shows side by side — monospace for
 * the source you type, the system face for what that source becomes. The page
 * is set in the same materials as the product, and loads no fonts to do it.
 */

:root {
    --ink: #1f2328;
    --ink-soft: #59636e;
    --paper: #ffffff;
    --surface: #f6f8fa;
    --rule: #d1d9e0;
    --blue: #0969da;
    --marker: #bc4c00;

    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace;
    --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", system-ui, sans-serif;

    --measure: 68rem;
    --step: clamp(1rem, 0.6rem + 1.4vw, 1.5rem);
}

@media (prefers-color-scheme: dark) {
    :root {
        --ink: #e6edf3;
        --ink-soft: #9198a1;
        --paper: #0d1117;
        --surface: #161b22;
        --rule: #30363d;
        --blue: #4493f8;
        --marker: #db6d28;
    }
}

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

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

body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

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

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
    border-radius: 2px;
}

.wrap {
    width: min(100% - 2.5rem, var(--measure));
    margin-inline: auto;
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
    left: 1rem;
    top: 1rem;
    z-index: 10;
    background: var(--paper);
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--rule);
}

/* ---- source-side vocabulary -------------------------------------------- */
/* Anything the reader would type is set in the editor's own voice. */

.src {
    font-family: var(--mono);
    font-size: 0.8125rem;
    line-height: 1.75;
    color: var(--ink);
    white-space: pre;
    tab-size: 2;
    margin: 0;
}
.src .mark { color: var(--blue); }
.src .bullet { color: var(--marker); }
.src .muted { color: var(--ink-soft); }

/* Not an eyebrow: it names the document the pane is showing, the way the
   editor's own title bar does. */
.filename {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-soft);
    margin: 0 0 0.75rem;
}

/* ---- header ------------------------------------------------------------ */

.masthead {
    position: sticky;
    top: 0;
    z-index: 5;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: saturate(1.6) blur(12px);
    border-bottom: 1px solid var(--rule);
}

.masthead .wrap {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    height: 3.5rem;
}

.wordmark {
    font-family: var(--mono);
    font-weight: 600;
    font-size: 0.9375rem;
    letter-spacing: -0.01em;
    color: var(--ink);
    text-decoration: none;
}
.wordmark .slash { color: var(--blue); }

.masthead nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    font-size: 0.875rem;
}
.masthead nav a { color: var(--ink-soft); text-decoration: none; }
.masthead nav a:hover { color: var(--ink); }

.lang { font-family: var(--mono); font-size: 0.75rem; color: var(--ink-soft); }
.lang [aria-current] { color: var(--ink); }

/* ---- the split: the page's one big idea -------------------------------- */

.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border: 1px solid var(--rule);
    border-radius: 10px;
    overflow: hidden;
    background: var(--paper);
}
.split > * { padding: var(--step); }
.split .side-src {
    background: var(--surface);
    border-right: 1px solid var(--rule);
    overflow-x: auto;
}

.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2rem, 4vw, 3.5rem); }

.rendered h1 {
    font-size: clamp(1.75rem, 1.1rem + 2.4vw, 2.75rem);
    line-height: 1.12;
    letter-spacing: -0.025em;
    margin: 0 0 0.6em;
    font-weight: 700;
}
.rendered p { margin: 0 0 1em; font-size: 1.0625rem; }
.rendered ul { margin: 0; padding-left: 1.15em; }
.rendered li { margin-bottom: 0.2em; }
.rendered strong { font-weight: 650; }

/* The rendered half resolves once, on load — the refraction the name promises. */
@media (prefers-reduced-motion: no-preference) {
    .hero .rendered > * {
        animation: settle 0.5s cubic-bezier(0.2, 0.7, 0.3, 1) backwards;
    }
    .hero .rendered > *:nth-child(1) { animation-delay: 0.05s; }
    .hero .rendered > *:nth-child(2) { animation-delay: 0.14s; }
    .hero .rendered > *:nth-child(3) { animation-delay: 0.23s; }
}
@keyframes settle {
    from { opacity: 0; transform: translateY(0.4rem); filter: blur(3px); }
    to { opacity: 1; transform: none; filter: none; }
}

/* ---- install ----------------------------------------------------------- */

.install {
    margin-top: 1.25rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.command {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--surface);
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 0.6rem 0.75rem 0.6rem 0.9rem;
    font-family: var(--mono);
    font-size: 0.875rem;
}
.command code { color: var(--ink); }
.command .prompt { color: var(--ink-soft); user-select: none; }

.copy {
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-soft);
    background: none;
    border: 1px solid var(--rule);
    border-radius: 6px;
    padding: 0.2rem 0.45rem;
    cursor: pointer;
}
.copy:hover { color: var(--ink); border-color: var(--ink-soft); }

.dmg {
    font-size: 0.9375rem;
    color: var(--ink);
    text-decoration: none;
    border-bottom: 1px solid var(--rule);
    padding-bottom: 1px;
}
.dmg:hover { border-color: var(--blue); color: var(--blue); }

.hero-meta {
    margin: 0.9rem 0 0;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-soft);
}

/* ---- sections ---------------------------------------------------------- */

section + section { border-top: 1px solid var(--rule); }

.band { padding: clamp(2.75rem, 6vw, 4.5rem) 0; }

.band > .wrap > h2 {
    font-size: clamp(1.35rem, 1rem + 1.2vw, 1.75rem);
    letter-spacing: -0.02em;
    margin: 0 0 0.4em;
    font-weight: 700;
}
.lede { margin: 0 0 2rem; max-width: 46ch; color: var(--ink-soft); }

/* Capability rows: what you type, and what it becomes. */
.rows { display: grid; gap: 1rem; }
.row .rendered { font-size: 0.9375rem; }
.row .rendered > :first-child { margin-top: 0; }
.row .rendered > :last-child { margin-bottom: 0; }

.formula {
    font-family: "Times New Roman", Times, serif;
    font-size: 1.35rem;
    font-style: italic;
}
.formula sub, .formula sup { font-size: 0.6em; font-style: normal; }

table.mini { border-collapse: collapse; font-size: 0.875rem; width: 100%; }
table.mini th, table.mini td {
    border: 1px solid var(--rule);
    padding: 0.3rem 0.55rem;
    text-align: left;
}
table.mini th { background: var(--surface); font-weight: 600; }

.task { list-style: none; padding: 0; margin: 0; }
.task li { display: flex; align-items: baseline; gap: 0.5rem; }
.task .box {
    width: 0.85em;
    height: 0.85em;
    border-radius: 3px;
    border: 1px solid var(--rule);
    display: inline-block;
    flex: none;
    translate: 0 0.1em;
}
.task .box.on { background: var(--blue); border-color: var(--blue); }

/* ---- native section ---------------------------------------------------- */

.specs {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
    gap: 1.5rem 2.5rem;
    margin: 0;
}
.specs div { border-top: 2px solid var(--ink); padding-top: 0.75rem; }
.specs dt { font-weight: 650; margin-bottom: 0.25rem; }
.specs dd { margin: 0; color: var(--ink-soft); font-size: 0.9375rem; }

/* ---- shots ------------------------------------------------------------- */

.shots {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
    gap: 1.75rem;
}
.shot { margin: 0; }
.shot img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
}

/* The app screenshots are light-mode captures. On the dark page they need an
   edge, or they read as bare white rectangles floating over the background. */
@media (prefers-color-scheme: dark) {
    .shot img, .rendered img { outline: 1px solid var(--rule); outline-offset: -1px; }
}
.shot figcaption {
    margin-top: 0.6rem;
    font-family: var(--mono);
    font-size: 0.75rem;
    color: var(--ink-soft);
}

/* ---- footer ------------------------------------------------------------ */

footer {
    border-top: 1px solid var(--rule);
    padding: 2.25rem 0 3rem;
    font-size: 0.875rem;
    color: var(--ink-soft);
}
footer .wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 2rem;
    align-items: baseline;
}
footer a { color: var(--ink-soft); }
footer a:hover { color: var(--ink); }
footer .spacer { margin-left: auto; }

/* ---- narrow ------------------------------------------------------------ */

@media (max-width: 46rem) {
    .split { grid-template-columns: 1fr; }
    .split .side-src { border-right: 0; border-bottom: 1px solid var(--rule); }
    .masthead nav { gap: 0.9rem; }
    .masthead nav .hide-sm { display: none; }
}

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