/* Notemark site. System fonts, no third-party requests. Tokens first. */
:root {
  color-scheme: light dark;
  --bg: light-dark(#fcfbfa, #0d0d0e);
  --surface: light-dark(#f5f2ee, #161618);
  --raise: light-dark(#ffffff, #2b2b31);
  --sub: light-dark(#ece8e3, #202024);
  --fg: light-dark(#1d1c1a, #efeeec);
  --muted: light-dark(#5f5b57, #a4a09b);
  --line: light-dark(#e7e3df, #2a2a2d);
  --accent: #d9531e;
  --accent-strong: #c24716;
  --accent-text: light-dark(#b3411a, #f47a46);
  --accent-soft: light-dark(#fdeee6, #2b1810);
  --thumb: light-dark(rgb(60 50 40 / .34), rgb(255 255 255 / .3));
  --code-bg: light-dark(#17171b, #060607);
  --code-bar: light-dark(#202027, #151519);
  --code-fg: #ebe9e6;
  --code-dim: #9b99a3;
  --tk-cmd: #ffa66d;
  --tk-flag: #7fd0e8;
  --tk-str: #a6d98b;
  --tk-url: #8fb4ff;
  --tk-op: #c4a7ff;
  --sh1: light-dark(rgb(30 20 10 / .08), rgb(0 0 0 / .45));
  --sh2: light-dark(rgb(30 20 10 / .22), rgb(0 0 0 / .7));
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "DejaVu Sans Mono", "Ubuntu Mono", Menlo, Consolas, monospace;
  --r: 14px;
  --wrap: 1120px;
  --ease: cubic-bezier(.22, .8, .24, 1);
}
[data-theme="light"] { color-scheme: light; }
[data-theme="dark"] { color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 72px; }

/* scrollbars: thin, invisible until the pointer is over the scrollable area (the page: while scrolling or near the right edge) */
html, pre, .table-wrap { scrollbar-width: thin; scrollbar-color: transparent transparent; }
pre:hover, pre:focus-visible, .table-wrap:hover, .table-wrap:focus-visible, html.is-scrolling, html.edge { scrollbar-color: var(--thumb) transparent; }
@supports not (scrollbar-color: auto) {
  html::-webkit-scrollbar, pre::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
  html::-webkit-scrollbar-track, pre::-webkit-scrollbar-track, .table-wrap::-webkit-scrollbar-track { background: transparent; }
  html::-webkit-scrollbar-thumb, pre::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { background: transparent; border-radius: 8px; border: 2px solid transparent; background-clip: content-box; }
  html.is-scrolling::-webkit-scrollbar-thumb, html.edge::-webkit-scrollbar-thumb, pre:hover::-webkit-scrollbar-thumb, .table-wrap:hover::-webkit-scrollbar-thumb { background-color: var(--thumb); }
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 1.0625rem/1.7 var(--font);
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
img, svg { max-width: 100%; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0; text-wrap: balance; }
p { margin: 0 0 1em; text-wrap: pretty; }
a { color: var(--accent-text); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 3px; border-radius: 6px; }
code, kbd { font-family: var(--mono); font-size: .88em; font-variant-ligatures: none; }
code { background: var(--sub); padding: .1em .38em; border-radius: 6px; }
kbd {
  display: inline-block; padding: .05em .45em; border-radius: 6px; line-height: 1.5;
  background: var(--raise); white-space: nowrap;
}
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; background: var(--fg); color: var(--bg); padding: 10px 16px; border-radius: 10px; transition: top .2s; }
.skip:focus { top: 12px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); }
.nav-in { display: flex; align-items: center; gap: 4px; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: 10px; margin-right: auto; font-weight: 700; letter-spacing: -.01em; color: var(--fg); text-decoration: none; }
.brand img { display: block; }
.nav ul { display: flex; gap: 2px; list-style: none; margin: 0; padding: 0; }
.nav ul a { position: relative; display: block; padding: 6px 12px; border-radius: 8px; color: var(--muted); font-size: .92rem; text-decoration: none; transition: color .2s, background-color .2s; }
.nav ul a:hover { color: var(--fg); background: var(--sub); }
.nav ul a[aria-current] { color: var(--fg); }
.nav ul a::after { content: ""; position: absolute; left: 12px; right: 12px; bottom: 2px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transition: transform .3s var(--ease); }
.nav ul a[aria-current]::after { transform: scaleX(1); }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--muted); cursor: pointer; transition: color .2s, background-color .2s, transform .2s var(--ease); }
.icon-btn:hover { color: var(--fg); background: var(--sub); }
.icon-btn:active { transform: scale(.92); }
.icon-btn .ico { grid-area: 1 / 1; transition: transform .45s var(--ease), opacity .3s; }
.ico-sun { opacity: 0; transform: rotate(-90deg) scale(.5); }
[data-theme="dark"] .ico-sun { opacity: 1; transform: none; }
[data-theme="dark"] .ico-moon { opacity: 0; transform: rotate(90deg) scale(.5); }
.ico-gh { fill: currentColor; stroke: none; width: 20px; height: 20px; }
#menu-btn { display: none; }
.ico-menu path { transition: transform .3s var(--ease), opacity .2s; transform-origin: center; transform-box: fill-box; }
#menu-btn[aria-expanded="true"] .l1 { transform: translateY(3px) rotate(45deg); }
#menu-btn[aria-expanded="true"] .l2 { transform: translateY(-3px) rotate(-45deg); }

@media (max-width: 820px) {
  #menu-btn { display: inline-grid; }
  .nav nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--bg); padding: 8px 20px 14px; opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .25s, transform .3s var(--ease), visibility 0s .3s; }
  .nav.open nav { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .nav ul { flex-direction: column; }
  .nav ul a { padding: 12px; font-size: 1rem; }
  .nav ul a::after { left: 12px; right: auto; width: 24px; }
}

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 22px; border-radius: 999px; background: var(--surface); color: var(--fg); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .25s var(--ease), background-color .2s, box-shadow .25s; }
.btn:hover { transform: translateY(-2px); background: var(--sub); text-decoration: none; box-shadow: 0 8px 20px -10px var(--sh2); }
.btn:active { transform: translateY(0); }
.btn .ico { transition: transform .25s var(--ease); }
.btn:hover .ico { transform: translateX(3px); }
.btn-primary { background: var(--accent-strong); color: #fff; }
.btn-primary:hover { background: #a93d12; }

/* hero */
.hero { position: relative; isolation: isolate; overflow: clip; padding: clamp(36px, 6vw, 72px) 0 clamp(40px, 7vw, 80px); text-align: center; }
.hero::before { content: ""; position: absolute; z-index: -1; left: 50%; top: -10%; width: min(900px, 140vw); aspect-ratio: 1; margin-left: calc(min(900px, 140vw) / -2); background: radial-gradient(closest-side, color-mix(in srgb, var(--accent) 22%, transparent), transparent); opacity: .6; animation: glow 12s ease-in-out infinite alternate; }
@keyframes glow { to { transform: translateY(40px) scale(1.08); } }
.pill { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 24px; padding: 5px 14px 5px 6px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: .85rem; }
.pill img { display: block; }
h1 { font-size: clamp(2.3rem, 6.4vw, 4.3rem); font-weight: 750; letter-spacing: -.04em; line-height: 1.04; max-width: 21ch; margin: 0 auto 22px; }
h1 em { font-style: normal; color: var(--accent-text); }
.lede { max-width: 56ch; margin: 0 auto 10px; font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: var(--muted); }
.sub { max-width: 56ch; margin: 0 auto 30px; font-size: .95rem; color: var(--muted); }
.cta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.meta { margin: 20px 0 0; font-size: .85rem; color: var(--muted); }
.stage { margin-top: clamp(40px, 7vw, 72px); }
.float { animation: float 7s ease-in-out infinite alternate; }
.parallax { will-change: transform; }
@keyframes float { to { transform: translateY(-10px); } }

/* window frame */
.win { position: relative; max-width: 1040px; margin-inline: auto; text-align: left; border-radius: 12px; background: var(--surface); overflow: hidden; box-shadow: 0 1px 2px var(--sh1), 0 10px 24px -8px var(--sh1), 0 40px 80px -24px var(--sh2); }
.win-body { background: var(--surface); line-height: 0; }
.win-body img { width: 100%; height: auto; aspect-ratio: 8 / 5; }
.t-light, .t-dark { display: block; }
.t-dark { display: none; }
[data-theme="dark"] .t-light { display: none; }
[data-theme="dark"] .t-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .t-light { display: none; }
  :root:not([data-theme]) .t-dark { display: block; }
}

/* sections */
section[id]:not(.hero) { padding: clamp(56px, 9vw, 112px) 0; }
.eyebrow { margin: 0 0 12px; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--accent-text); }
h2 { font-size: clamp(1.8rem, 4vw, 2.7rem); font-weight: 720; letter-spacing: -.035em; line-height: 1.1; margin-bottom: 16px; }
h3 { font-size: 1.1rem; font-weight: 650; margin-bottom: 8px; }
.intro { max-width: 62ch; color: var(--muted); font-size: 1.1rem; margin-bottom: 36px; }
.center { text-align: center; }
.center .intro { margin-inline: auto; }

/* showcase */
.seg { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); width: min(100%, 380px); margin: 0 auto 32px; padding: 4px; border-radius: 999px; background: var(--sub); }
.seg::before { content: ""; position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc((100% - 8px) / 3); border-radius: 999px; background: var(--raise); box-shadow: 0 1px 3px var(--sh1); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .45s var(--ease); }
.seg button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; border: 0; border-radius: 999px; background: none; color: var(--muted); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; transition: color .2s; }
.seg button:hover, .seg button[aria-selected="true"] { color: var(--fg); }
.shot .panel:not([hidden]) { animation: rise .5s var(--ease); }
.cap { margin: 22px auto 0; max-width: 60ch; text-align: center; color: var(--muted); }

/* features */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; list-style: none; margin: 0; padding: 0; }
.cards li { position: relative; padding: 26px; border-radius: var(--r); background: var(--surface); transition: transform .35s var(--ease), box-shadow .35s; }
.cards li:hover { transform: translateY(-4px); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); box-shadow: 0 18px 36px -22px var(--sh2); }
.cards li p code { white-space: nowrap; }
.cards li p { margin: 0; color: var(--muted); font-size: .95rem; }
.cards .wide { grid-column: span 2; }
.cards .full { grid-column: 1 / -1; }
.cards .full p { max-width: 70ch; }
.ci { display: grid; place-items: center; width: 42px; height: 42px; margin-bottom: 18px; border-radius: 12px; background: var(--accent-soft); color: var(--accent-text); transition: background-color .3s, color .3s, transform .4s var(--ease); }
.ci .ico { width: 20px; height: 20px; }
.cards li:hover .ci { background: var(--accent-strong); color: #fff; transform: rotate(-6deg) scale(1.06); }
.hi { width: 18px; height: 18px; margin-right: 8px; vertical-align: -3px; color: var(--accent-text); }

/* typing demo (CSS only) */
.demo { margin-top: 18px; padding: 6px 16px; border-radius: 10px; background: var(--sub); }
.demo-row { display: flex; align-items: center; gap: 14px; min-height: 52px; }
.demo-k { flex: none; width: 5rem; white-space: nowrap; font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.demo-raw { position: relative; font-family: var(--mono); font-size: .95rem; }
.typed { display: inline-block; clip-path: inset(0 100% 0 0); animation: type 8s steps(15, end) infinite; }
.demo-raw::after { content: ""; position: absolute; left: 0; top: 50%; width: 2px; height: 1.2em; margin-top: -.6em; background: var(--accent); animation: caret 8s steps(15, end) infinite, blink 1s steps(1) infinite; }
.demo-out { font-size: 1.45rem; font-weight: 700; letter-spacing: -.02em; animation: out 8s var(--ease) infinite; }
@keyframes type { 0%, 5% { clip-path: inset(0 100% 0 0); } 35%, 88% { clip-path: inset(0 0 0 0); } 94%, 100% { clip-path: inset(0 100% 0 0); } }
@keyframes caret { 0%, 5% { transform: translateX(0); } 35%, 88% { transform: translateX(15ch); } 94%, 100% { transform: translateX(0); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes out { 0%, 36% { opacity: 0; transform: translateY(8px); } 44%, 88% { opacity: 1; transform: none; } 94%, 100% { opacity: 0; transform: translateY(8px); } }

/* install tabs */
.tablist { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.tablist:not(.seg) button { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px; border-radius: 999px; background: var(--surface); color: var(--muted); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; transition: color .2s, background-color .2s, transform .25s var(--ease); }
.tablist:not(.seg) button:hover { color: var(--fg); background: var(--sub); transform: translateY(-1px); }
.tablist:not(.seg) button[aria-selected="true"] { color: var(--accent-text); background: var(--accent-soft); }
.tag { padding: 1px 8px; border-radius: 999px; background: var(--accent-strong); color: #fff; font-size: .7rem; letter-spacing: .02em; }
.tabs .panel:not([hidden]) { animation: rise .45s var(--ease); }
.panel h3 { font-size: 1.2rem; }
.panel > p { color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* code: dark terminal surface in both themes */
.code { margin: 0 0 20px; overflow: hidden; border-radius: 12px; background: var(--code-bg); color: var(--code-fg); box-shadow: 0 14px 30px -22px var(--sh2); }
.code-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 6px 6px 14px; background: var(--code-bar); }
.code-lang { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .04em; color: var(--code-dim); }
.code-lang .ico { width: 15px; height: 15px; }
.code pre { margin: 0; padding: 16px 18px; overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; tab-size: 2; font-family: var(--mono); font-size: .875rem; line-height: 1.75; white-space: pre;
  background:
    linear-gradient(to right, var(--code-bg) 30%, transparent) left / 28px 100% no-repeat local,
    linear-gradient(to left, var(--code-bg) 30%, transparent) right / 28px 100% no-repeat local,
    linear-gradient(to right, rgb(255 255 255 / .1), transparent) left / 14px 100% no-repeat scroll,
    linear-gradient(to left, rgb(255 255 255 / .1), transparent) right / 14px 100% no-repeat scroll; }
.code code { padding: 0; border: 0; background: none; color: inherit; font-size: inherit; white-space: pre; }
.code ::selection { background: rgb(255 166 109 / .3); }
.tk-c { color: var(--code-dim); font-style: italic; }
.tk-k { color: var(--tk-cmd); }
.tk-f { color: var(--tk-flag); }
.tk-s { color: var(--tk-str); }
.tk-u { color: var(--tk-url); }
.tk-o { color: var(--tk-op); }
.copy { display: inline-flex; align-items: center; justify-content: center; gap: 7px; flex: none; width: 92px; height: 32px; padding: 0; border: 0; border-radius: 8px; background: rgb(255 255 255 / .06); color: var(--code-fg); font: 600 .8rem/1 var(--font); cursor: pointer; transition: background-color .2s, color .2s, transform .2s var(--ease); }
.copy:hover { background: rgb(255 255 255 / .13); }
.copy:active { transform: scale(.96); }
.copy:focus-visible { outline: 2px solid var(--tk-cmd); outline-offset: 2px; }
.copy-ic { display: inline-grid; }
.copy .ico { grid-area: 1 / 1; width: 15px; height: 15px; transition: transform .3s var(--ease), opacity .2s; }
.copy .ico-check { opacity: 0; transform: scale(.4); }
.copy.is-copied { color: var(--tk-str); }
.copy.is-copied .ico-copy { opacity: 0; transform: scale(.4); }
.copy.is-copied .ico-check { opacity: 1; transform: none; }

/* usage, tables */
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; margin: 40px 0 56px; }
.grid3 p, .about p, #build > .wrap > p { color: var(--muted); font-size: .95rem; }
.table-wrap { overflow-x: auto; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; border-radius: 12px;
  background:
    linear-gradient(to right, var(--surface) 30%, transparent) left / 28px 100% no-repeat local,
    linear-gradient(to left, var(--surface) 30%, transparent) right / 28px 100% no-repeat local,
    linear-gradient(to right, var(--sh1), transparent) left / 14px 100% no-repeat scroll,
    linear-gradient(to left, var(--sh1), transparent) right / 14px 100% no-repeat scroll,
    var(--surface); }
table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: .93rem; font-variant-numeric: tabular-nums; }
th, td { padding: 11px 18px; text-align: left; vertical-align: top; }
th { background: var(--sub); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
tbody tr { transition: background-color .2s; }
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--sub) 40%, transparent); }
tbody tr:hover td { background: var(--sub); }
td:first-child { width: 48%; }
td code { white-space: normal; overflow-wrap: anywhere; }
h3 + .table-wrap, h3 + .code { margin-top: 12px; }
#build h3 { margin-top: 36px; }
#changelog, #about { background: var(--surface); }
.about { display: grid; grid-template-columns: repeat(2, 1fr); gap: 32px; }

footer { background: var(--sub); padding: 32px 0 44px; color: var(--muted); font-size: .9rem; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }
.foot p { margin: 0; }

/* motion that needs the script: reveal on scroll, theme fade fallback */
@media (prefers-reduced-motion: no-preference) {
  .js .rv:not(.in) { opacity: 0; }
  .rv.in { animation: rise .8s var(--ease) var(--d, 0s) backwards; }
  .theme-fade, .theme-fade *, .theme-fade *::before, .theme-fade *::after { transition: background-color .35s, color .35s !important; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; transition-delay: 0s !important; }
  .typed { clip-path: none; }
  .demo-raw::after { display: none; }
}

@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .cards .wide { grid-column: 1 / -1; }
  .grid3 { grid-template-columns: 1fr; gap: 24px; margin: 28px 0 40px; }
}
@media (max-width: 600px) {
  .cards, .about { grid-template-columns: 1fr; }
  .cards li { padding: 22px; }
  .code pre { padding: 14px 16px; font-size: .84rem; }
  th, td { padding: 10px 12px; }
  td:first-child { width: auto; }
  .btn { flex: 1 1 140px; }
}
