@font-face { font-family: Geist; src: url(fonts/geist-latin-wght-normal.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist Mono'; src: url(fonts/geist-mono-latin-wght-normal.woff2) format('woff2'); font-weight: 100 900; font-display: swap; }

:root {
  --bg: #09090a; --panel: #111112; --panel-2: #18181a;
  --fg: #f2ede4; --fg-2: #cfc9bf; --muted: #8f8980;
  --line: rgb(242 237 228 / .1); --line-2: rgb(242 237 228 / .2);
  --accent: #efe8dc; --on-accent: #0b0a09; --danger: #e5484d;
  --ease: cubic-bezier(.23, 1, .32, 1); --ease-hero: cubic-bezier(.25, 1, .5, 1);
  --r: 14px; --container: 1360px; --gutter: clamp(16px, 3vw, 32px);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.5 Geist, system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
code { font: 13px 'Geist Mono', monospace; background: var(--panel-2); padding: 2px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: 12px; top: -60px; background: var(--accent); color: var(--on-accent); padding: 10px 14px; border-radius: 10px; z-index: 99; }
.skip:focus { top: 12px; }
:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; border-radius: 6px; }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; height: 64px; padding: 0 var(--gutter);
  background: linear-gradient(var(--bg) 40%, rgb(9 9 10 / 0)); }
.nav::after { content: ''; position: absolute; inset: 0; z-index: -1; backdrop-filter: blur(10px); mask: linear-gradient(#000 50%, transparent); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 16px; letter-spacing: -.01em; }
.brand b { font-weight: 600; }
.brand-mark { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--accent); color: var(--on-accent); font-weight: 700; font-size: 14px; }
.brand-mark.big { width: 44px; height: 44px; border-radius: 12px; font-size: 22px; }
.nav-links { display: flex; gap: 4px; margin: 0 auto; padding: 4px; border: 1px solid var(--line); border-radius: 999px; background: rgb(17 17 18 / .7); }
.nav-links a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--muted); transition: color .2s var(--ease), background .2s var(--ease); }
.nav-links a:hover { color: var(--fg); }
.nav-links a[aria-current] { color: var(--fg); background: var(--panel-2); }
.link-btn { background: none; border: 0; padding: 6px 4px; color: var(--muted); cursor: pointer; }
.link-btn:hover { color: var(--fg); }

/* botões */
.btn { display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--accent); color: var(--on-accent); font-weight: 500; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .5), 0 10px 30px -12px rgb(239 232 220 / .3); transition: transform .2s var(--ease), background .2s var(--ease); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn:active { transform: scale(.97); }
.btn.ghost { background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn.ghost:hover { background: var(--panel-2); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 14px; }
.btn.danger { color: var(--danger); }
.btn[data-done] { background: #c9f2c7; }

/* login */
.login { min-height: 100svh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(380px, 100%); display: grid; gap: 8px; }
.login-card h1 { margin: 16px 0 0; font-size: 32px; font-weight: 400; letter-spacing: -.03em; }
.login-card p { margin: 0 0 16px; }
.stack { display: grid; gap: 14px; }
.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.field input, .field textarea { width: 100%; padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel); color: var(--fg); font-size: 15px; }
.field textarea { font: 13px/1.5 'Geist Mono', monospace; resize: vertical; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--fg-2); }
.error { color: var(--danger); margin: 0; }
.notice { margin: 0 var(--gutter) 16px; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 10px; max-width: var(--container); }

/* biblioteca */
.lib-hero { max-width: var(--container); margin: 0 auto; padding: 72px var(--gutter) 40px; }
.lib-hero.small { padding-top: 48px; }
.lib-hero h1 { margin: 0; max-width: 14ch; font-size: clamp(40px, 6vw, 76px); font-weight: 400; letter-spacing: -.04em; line-height: .98; }
.lib-hero.small h1 { font-size: clamp(36px, 4.4vw, 56px); max-width: none; }
.lead { max-width: 56ch; margin: 18px 0 0; color: var(--fg-2); font-size: 17px; }
.lib { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter) 96px; }
.lib-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; padding: 16px 0 24px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 34px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; color: var(--muted); cursor: pointer; transition: all .2s var(--ease); }
.chip span { margin-left: 4px; font: 12px 'Geist Mono', monospace; opacity: .7; }
.chip:hover { color: var(--fg); border-color: var(--line-2); }
.chip[aria-pressed="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.search { display: flex; align-items: center; gap: 8px; height: 38px; padding: 0 14px; min-width: min(320px, 100%); border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.search svg { width: 16px; height: 16px; }
.search input { flex: 1; background: none; border: 0; outline: none; min-width: 0; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 28px 20px; }
.card { text-decoration: none; display: grid; gap: 12px; }
.card-media { position: relative; aspect-ratio: 4 / 3; border-radius: var(--r); overflow: hidden; background: var(--tint); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease), filter .6s var(--ease); filter: saturate(.9); }
.card-media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 45%, rgb(0 0 0 / .55)); }
.card-name { position: absolute; left: 18px; bottom: 14px; z-index: 1; font-size: 34px; letter-spacing: -.03em; color: #fff; }
.card .tag { position: absolute; top: 12px; left: 12px; z-index: 1; padding: 3px 9px; border-radius: 999px; background: var(--accent); color: var(--on-accent); font-size: 12px; font-weight: 500; }
.card:hover .card-media img { transform: scale(1.03); filter: saturate(1); }
.card-body { display: grid; gap: 2px; }
.card-body strong { font-weight: 500; }
.card-body .muted { font-size: 14px; }
.empty { padding: 40px 0; }

/* item */
.crumbs { max-width: var(--container); margin: 0 auto; padding: 24px var(--gutter) 0; display: flex; gap: 8px; color: var(--muted); font-size: 14px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.item { max-width: var(--container); margin: 0 auto; padding: 24px var(--gutter) 48px; display: grid; grid-template-columns: 360px 1fr; gap: 40px; align-items: start; }
.item-head.solo { max-width: var(--container); margin: 0 auto; padding: 24px var(--gutter) 24px; }
.kicker { margin: 0; color: var(--muted); font-size: 13px; letter-spacing: .02em; }
.item-head h1 { margin: 8px 0 0; font-size: clamp(40px, 4.6vw, 64px); font-weight: 400; letter-spacing: -.04em; line-height: 1; }
.item-head .lead { font-size: 16px; }
.item-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.item-actions form { margin: 0; }
.facts { margin: 32px 0 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.facts div { padding: 14px 0; border-bottom: 1px solid var(--line); display: grid; gap: 2px; }
.facts dt { color: var(--muted); font-size: 13px; }
.facts dd { margin: 0; font-size: 14px; color: var(--fg-2); }
.viewer { position: sticky; top: 80px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); overflow: hidden; }
.viewer-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.seg { display: flex; gap: 2px; padding: 3px; background: var(--bg); border-radius: 999px; }
.seg button { border: 0; background: none; color: var(--muted); padding: 5px 12px; border-radius: 999px; cursor: pointer; font-size: 13px; }
.seg button[aria-pressed="true"] { background: var(--panel-2); color: var(--fg); }
.viewer-stage { position: relative; height: min(76vh, 760px); overflow: hidden; display: flex; justify-content: center; background: #050505; }
.viewer-stage iframe { border: 0; background: #fff; transform-origin: top center; flex: none; }

/* docs */
.docs { max-width: 920px; margin: 0 auto; padding: 24px var(--gutter) 120px; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.tabs button { border: 0; background: none; color: var(--muted); padding: 12px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--fg); border-color: var(--fg); }
.md { color: var(--fg-2); font-size: 15px; line-height: 1.7; }
.md h1, .md h2, .md h3 { color: var(--fg); font-weight: 500; letter-spacing: -.02em; line-height: 1.2; }
.md h1 { font-size: 30px; font-weight: 400; letter-spacing: -.03em; }
.md h2 { font-size: 22px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.md h3 { font-size: 17px; margin-top: 32px; }
.md strong { color: var(--fg); font-weight: 500; }
.md code { font-size: 12.5px; }
.md pre { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px; overflow: auto; }
.md pre code { background: none; padding: 0; }
.md table { width: 100%; border-collapse: collapse; font-size: 14px; }
.md th, .md td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.md li { margin: 4px 0; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* licenciados */
.lic { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter) 96px; display: grid; grid-template-columns: 1fr 380px; gap: 40px; align-items: start; }
.lic-list { display: grid; border-top: 1px solid var(--line); }
.lic-list.wide { max-width: var(--container); margin: 0 auto 96px; padding: 0 var(--gutter); border: 0; }
.row { display: grid; grid-template-columns: 1.2fr 1fr 1.2fr auto; gap: 16px; align-items: center; padding: 16px 4px; border-bottom: 1px solid var(--line); text-decoration: none; }
a.row:hover { background: var(--panel); }
.lic-form { padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); }
.lic-form h2 { margin: 0 0 4px; font-weight: 500; font-size: 18px; }

/* entrada do título */
[data-split] .w { display: inline-block; animation: rise 1s var(--ease-hero) both; animation-delay: calc(80ms + var(--i) * 40ms); }
@keyframes rise { from { opacity: 0; filter: blur(12px); transform: translateY(.18em); } }

@media (max-width: 980px) {
  .item, .lic { grid-template-columns: 1fr; }
  .viewer { position: relative; top: 0; }
  .row { grid-template-columns: 1fr; gap: 2px; }
  .nav-links { margin: 0; }
}
@media (max-width: 560px) {
  .nav { gap: 10px; }
  .brand span:last-child { display: none; }
  .nav-links a { padding: 6px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
