/* Support, Privacy and Terms. Same Petal tokens, glass header and footer as
   the landing (site/template.html); keep them in step when either changes. */
:root {
  --bg: #FFF3F3; --deep: #FCE6E8; --card: #FFFFFF; --raised: #FFF8F8;
  --ink: #18171A; --muted: #68636A; --faint: #8A848C; --body: #3A363C;
  --em: #B9485B; --accent: #FFB6B8; --soft: #FFE9EA;
  --line: rgba(24,23,26,.08); --line-strong: rgba(24,23,26,.18);
  --glass: rgba(255,255,255,.72); --glass-line: rgba(24,23,26,.07);
  --shadow: 0 1px 2px rgba(150,60,72,.06), 0 18px 44px rgba(150,60,72,.10);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0E0E10; --deep: #161618; --card: #1C1C1F; --raised: #242428;
  --ink: #F5F5F7; --muted: #B4B3BA; --faint: #8A898F; --body: #D4D3D9;
  --em: #FFC6C8; --soft: #3E3032;
  --line: #2C2C31; --line-strong: #3A3A40;
  --glass: rgba(24,24,27,.72); --glass-line: #2C2C31;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 18px 44px rgba(0,0,0,.4);
  color-scheme: dark;
}
html, body { overflow-x: clip; }
body { background: var(--bg); color: var(--ink); font-size: 17px; line-height: 1.5; transition: background-color .4s, color .4s; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.ink-only { display: block; } .white-only { display: none !important; }
[data-theme="dark"] .ink-only { display: none !important; } [data-theme="dark"] .white-only { display: block !important; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 99; background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; }
.skip:focus { top: 12px; }

/* glass header */
.top { position: sticky; top: 14px; z-index: 60; width: calc(100% - 24px); max-width: 860px; margin: 16px auto 0; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 12px 10px 20px; border: 1px solid var(--glass-line); border-radius: 100px; background: var(--glass); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5); box-shadow: 0 10px 34px rgba(91,60,60,.08); transition: box-shadow .35s ease, max-width .45s cubic-bezier(.2,.65,.2,1); }
.top.scrolled { max-width: 560px; box-shadow: 0 10px 34px rgba(91,60,60,.14); }
[data-theme="dark"] .top { box-shadow: 0 10px 34px rgba(0,0,0,.45); }
.top-logo { display: inline-flex; flex-shrink: 0; }
.top-logo img { height: 28px; width: auto; }
/* big header: the wordmark alone. tucked in (blog, once scrolled): the symbol alone. */
.logo-word, .logo-sym { transition: max-width .35s, opacity .3s; }
.logo-word { max-width: 130px; opacity: 1; }
.logo-sym { max-width: 0; opacity: 0; }
.top.scrolled .logo-word { max-width: 0; opacity: 0; }
.top.scrolled .logo-sym { max-width: 40px; opacity: 1; }
.links { display: flex; align-items: center; gap: 24px; font-size: 14px; font-weight: 600; color: var(--muted); max-width: 640px; transition: max-width .4s, opacity .3s; }
/* tucked in and on small screens: the icons stay, the text links go */
.top.scrolled .links { max-width: 0; opacity: 0; overflow: hidden; visibility: hidden; }
.links a { position: relative; text-decoration: none; padding: 4px 0; white-space: nowrap; }
.links a::after { content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0; border-radius: 2px; background: var(--accent); transition: width .28s ease; }
.links a:hover, .links a[aria-current] { color: var(--ink); }
.links a:hover::after, .links a[aria-current]::after { width: 100%; }
.ctrls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.status { display: inline-flex; align-items: center; padding: 9px 15px; border-radius: 100px; background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 700; text-decoration: none; white-space: nowrap; transition: transform .25s, box-shadow .25s; }
.status:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(185,72,91,.25); }
.pill-btn { appearance: none; border: 1px solid var(--line-strong); background: transparent; color: var(--muted); border-radius: 100px; height: 34px; width: 34px; padding: 0; cursor: pointer; display: inline-grid; place-items: center; transition: color .2s, border-color .2s, transform .2s; }
.pill-btn:hover { color: var(--ink); border-color: var(--muted); transform: rotate(18deg); }
.pill-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.pill-btn.lang-btn { width: auto; min-width: 34px; padding: 0 12px; font-size: 12px; font-weight: 700; letter-spacing: .05em; list-style: none; }
.pill-btn.lang-btn:hover { transform: none; }
.pill-btn.lang-btn::-webkit-details-marker { display: none; }
.langs { position: relative; }
.lang-menu { position: absolute; right: 0; top: calc(100% + 10px); min-width: 210px; max-height: min(70vh, 460px); overflow: auto; padding: 8px; border-radius: 22px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow); display: grid; gap: 2px; }
.lang-menu a { display: flex; justify-content: space-between; gap: 16px; padding: 10px 12px; border-radius: 14px; text-decoration: none; font-size: 15px; font-weight: 600; }
.lang-menu a:hover { background: var(--raised); }
.lang-menu a[aria-current] { background: var(--soft); }
.lang-menu small { color: var(--faint); font-weight: 700; font-size: 12px; letter-spacing: .04em; }
.pill-btn .moon { display: none; } [data-theme="dark"] .pill-btn .sun { display: none; } [data-theme="dark"] .pill-btn .moon { display: block; }

/* document */
.doc { width: min(760px, calc(100% - 48px)); margin: 72px auto 0; }
.doc > .meta { display: inline-block; margin: 0 0 18px; padding: 6px 12px; border-radius: 999px; background: var(--soft); color: var(--em); font-size: 13px; font-weight: 700; }
.doc h1 { font-size: clamp(44px, 7vw, 72px); font-weight: 700; letter-spacing: -.035em; line-height: 1; margin: 0 0 28px; }
.doc h1::after { content: "."; color: var(--em); }
.doc > p:first-of-type:not(.meta), .doc > .meta + h1 + p { font-size: 19px; line-height: 1.55; color: var(--muted); }
.doc h2 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.2; margin: 52px 0 12px; padding-top: 28px; border-top: 1px solid var(--line); }
.doc h3 { font-size: 17px; font-weight: 700; letter-spacing: -.01em; line-height: 1.35; margin: 28px 0 6px; }
.doc p, .doc li { color: var(--body); font-size: 16px; line-height: 1.7; }
.doc p { margin: 0 0 14px; }
.doc ul, .doc ol { margin: 0 0 14px; padding-left: 1.2em; list-style: disc; }
.doc ol { list-style: decimal; }
.doc li { margin: 6px 0; }
.doc li::marker { color: var(--em); }
.doc strong, .doc b { color: var(--ink); font-weight: 700; }
.doc a { color: var(--em); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.doc a:hover { text-decoration-thickness: 2px; }
.doc .note { margin-top: 8px; padding: 18px 22px; border-radius: 22px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow); font-size: 15px; }

/* blog */
.doc > .meta a { color: inherit; text-decoration: none; }
.doc h1.nodot::after { content: none; }
.post h1 { font-size: clamp(36px, 5.6vw, 56px); line-height: 1.08; }
.post-cta { display: flex; align-items: center; gap: 16px; margin-top: 48px; padding: 18px 18px 18px 20px; border-radius: 28px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.post-cta-sig { flex-shrink: 0; width: 52px; height: 52px; border-radius: 50%; background: var(--soft); display: grid; place-items: center; font-size: 26px; }
.post-cta div { flex: 1; min-width: 0; }
.post-cta strong { display: block; font-size: 17px; }
.doc .post-cta p { margin: 2px 0 0; font-size: 15px; color: var(--muted); }
.doc .post-cta .status { color: var(--bg); text-decoration: none; }
.post-list { list-style: none !important; padding: 0 !important; display: grid; gap: 14px; }
.post-list li { margin: 0; }
.doc .post-list a { display: grid; gap: 6px; padding: 22px 24px; border-radius: 24px; background: var(--card); box-shadow: 0 0 0 1px var(--line), var(--shadow); color: var(--ink); text-decoration: none; transition: transform .25s; }
.doc .post-list a:hover { transform: translateY(-2px); }
.post-list time { font-size: 13px; font-weight: 700; color: var(--em); }
.post-list strong { font-size: 22px; letter-spacing: -.02em; line-height: 1.2; }
.post-list span { color: var(--muted); font-size: 15px; line-height: 1.55; }

/* footer */
footer { width: min(760px, calc(100% - 48px)); margin: 88px auto 0; padding: 28px 0 48px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
footer img { height: 20px; width: auto; }
footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
footer a { text-decoration: none; }
footer a:hover { color: var(--ink); }
footer .made { margin-left: auto; }

@media (max-width: 640px) {
  .top { padding: 8px 8px 8px 16px; gap: 10px; }
  .top-logo img { height: 24px; }
  .links { display: none; }
  .top.scrolled { max-width: none; }
  .doc { margin-top: 48px; }
  .doc h2 { margin-top: 40px; }
  footer .made { margin-left: 0; width: 100%; }
  .post-cta { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
