@font-face { font-family: "Geist"; src: url("fonts/geist.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("fonts/geist-mono.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Fragment Mono"; src: url("fonts/fragment-mono.woff2") format("woff2"); font-weight: 400; font-display: swap; }

:root {
  color-scheme: dark;
  --black: #000;
  --prey-900: #19161d;
  --prey-800: #211d25;
  --prey-750: #28242e;
  --prey-700: #352f3d;
  --prey-600: #4a464e;
  --prey-400: #928d9a;
  --prey-300: #c1bec6;
  --prey-100: #f2f1f4;
  --white: #fafafa;
  --purple-300: #c59eff;
  --purple-400: #9e61ff;
  --purple-500: #9147ff;
  --purple-700: #7a0ecd;
  --purple-900: #471d86;
  --green: #35d482;
  --yellow: #f0d033;
  --red: #f94358;

  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-display: "Geist Mono", ui-monospace, monospace;
  --font-code: "Fragment Mono", ui-monospace, monospace;

  --fs-h1: clamp(2.5rem, 1.6rem + 3.9vw, 4.25rem);
  --fs-h2: clamp(1.6875rem, 1.5rem + 0.83vw, 2.0625rem);
  --fs-h3: clamp(1.1875rem, 1.15rem + 0.15vw, 1.25rem);
  --fs-lead: clamp(1.125rem, 1.08rem + 0.2vw, 1.25rem);
  --fs-sm: 0.8125rem;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --gutter: clamp(1rem, 0.5rem + 2.4vw, 3rem);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--black);
  color: var(--prey-300);
  font: 400 1rem/1.55 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: #8627e5; color: #fff; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--black); }
::-webkit-scrollbar-thumb { background: var(--prey-700); border-radius: 10px; border: 2px solid var(--black); }
::-webkit-scrollbar-thumb:hover { background: var(--prey-600); }
html { scrollbar-color: var(--prey-700) var(--black); }

h1, h2, h3 { color: var(--white); font-family: var(--font-display); font-weight: 700; letter-spacing: -0.03em; text-wrap: balance; margin: 0; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--purple-400); text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--purple-400) 40%, transparent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; transition: color .2s, text-decoration-color .2s; }
a:hover { color: var(--purple-300); text-decoration-color: currentColor; }
strong { color: var(--prey-100); font-weight: 600; }
em { font-style: normal; color: var(--prey-100); }
code, kbd { font-family: var(--font-code); font-size: 0.875em; }
code { color: var(--prey-100); background: var(--prey-750); padding: 0.1em 0.4em; border-radius: 6px; overflow-wrap: anywhere; }
kbd { color: var(--prey-100); background: var(--prey-800); border: 1px solid var(--prey-600); border-bottom-width: 2px; padding: 0.05em 0.45em; border-radius: 6px; white-space: nowrap; }
:focus-visible { outline: 2px solid var(--purple-400); outline-offset: 3px; border-radius: 6px; }
input { caret-color: var(--purple-400); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 50; background: var(--purple-500); color: #fff; padding: .6rem 1rem; border-radius: 12px; text-decoration: none; }
.skip:focus { top: 1rem; }
svg.stroke, .stroke { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* Nav */
.nav-wrap { position: sticky; top: 0; z-index: 20; padding: 0.5rem; }
.nav {
  max-width: 1480px; margin: 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 0.5rem 0.5rem 0.5rem 1.25rem; border-radius: 18px; border: 1px solid transparent;
  background: color-mix(in srgb, var(--black) 72%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  transition: border-color .3s, background .3s; position: relative;
}
.nav.scrolled { border-color: var(--prey-700); background: color-mix(in srgb, var(--prey-900) 80%, transparent); }
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--white); text-decoration: none; font-family: var(--font-display); font-weight: 700; font-size: .95rem; letter-spacing: -0.02em; }
.brand:hover { color: var(--white); }
.brand-mark { width: 26px; height: 26px; flex: none; }
.nav-links { list-style: none; margin: 0; padding: 0; display: flex; gap: .25rem; position: absolute; left: 50%; transform: translateX(-50%); }
.nav-links a { display: block; padding: .45rem .8rem; border-radius: 10px; color: var(--prey-300); text-decoration: none; font-family: var(--font-display); font-size: .875rem; font-weight: 500; transition: background .2s, color .2s; }
.nav-links a:hover { background: var(--prey-700); color: var(--prey-100); }

/* Buttons */
.btn {
  position: relative; isolation: isolate; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font: 500 1rem/1 var(--font-sans); border-radius: 16px; padding: .85rem 1.5rem; text-decoration: none; cursor: pointer; border: 0;
  transition: color .35s var(--ease-out), opacity .2s;
}
.btn-primary { background: var(--purple-500); color: #fff; }
.btn-primary::before {
  content: ""; position: absolute; inset: 0; z-index: -1; background: #fff; border-radius: 999px;
  transform: translateY(50%) scale(0); transition: transform .35s var(--ease-out);
}
.btn-primary:hover { color: #000; }
.btn-primary:hover::before { transform: translateY(0) scaleX(1.5) scaleY(2.2); }
.btn-primary[aria-disabled="true"] { opacity: .4; pointer-events: none; }
.btn-ghost { background: transparent; color: var(--prey-300); border: 1px solid var(--prey-700); border-radius: 12px; padding: .7rem 1.1rem; font-size: .9375rem; }
.btn-ghost:hover:not(:disabled) { color: var(--prey-100); background: var(--prey-800); }
.btn-ghost:disabled { opacity: .4; cursor: not-allowed; }
.btn-ghost.done { color: var(--green); border-color: color-mix(in srgb, var(--green) 45%, transparent); }
.nav-cta { padding: .55rem 1rem; font-size: .875rem; }

/* Hero */
main { max-width: 1480px; margin: 0 auto; padding: 0 var(--gutter); }
.hero {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(2rem, 4vw, 5rem); align-items: end;
  padding: clamp(3.5rem, 8vw, 7.5rem) 0 clamp(2.5rem, 5vw, 4.5rem);
}
.hero h1 { font-size: var(--fs-h1); line-height: 1.05; max-width: 19ch; }
.lead { font-size: var(--fs-lead); line-height: 1.5; color: var(--prey-300); max-width: 46ch; margin-top: 1.5rem; }
.hero-meta { display: inline-flex; align-items: center; gap: .55rem; margin-top: 1.75rem; font-family: var(--font-code); font-size: var(--fs-sm); color: var(--prey-400); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 3px color-mix(in srgb, var(--green) 20%, transparent); }

.identity { border: 0; margin: 0; padding: 0; min-width: 0; }
.identity legend { font-family: var(--font-display); color: var(--white); font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.02em; padding: 0; }
.identity-hint { font-size: .875rem; color: var(--prey-400); margin: .4rem 0 1rem; }
.identity-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; }
.id-tile {
  position: relative; display: grid; grid-template-columns: 24px 1fr; grid-template-rows: auto auto; column-gap: .75rem; align-items: center;
  padding: 1rem; border-radius: 16px; background: var(--prey-900); border: 1px solid var(--prey-800); cursor: pointer; align-content: center;
  transition: background .25s, border-color .25s, transform .35s var(--ease-out);
}
.id-tile:hover { background: var(--prey-800); border-color: var(--prey-700); }
.id-tile input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.id-tile svg { grid-row: span 2; width: 22px; height: 22px; color: var(--prey-300); fill: var(--prey-300); }
.id-tile svg.stroke { fill: none; }
.id-name { color: var(--prey-100); font-weight: 500; font-size: .9375rem; line-height: 1.25; }
.id-sub { color: var(--prey-400); font-size: var(--fs-sm); line-height: 1.3; }
.id-tile:has(input:checked) { background: color-mix(in srgb, var(--purple-500) 16%, var(--prey-900)); border-color: var(--purple-500); }
.id-tile:has(input:checked) svg { color: var(--purple-300); fill: var(--purple-300); }
.id-tile:has(input:checked) svg.stroke { fill: none; }
.id-tile:has(input:focus-visible) { outline: 2px solid var(--purple-400); outline-offset: 3px; }
.identity-note { margin-top: .9rem; font-size: .875rem; color: var(--prey-300); padding: .75rem 1rem; border-radius: 12px; background: var(--prey-900); border: 1px solid var(--prey-700); }
.identity-note.org { border-color: color-mix(in srgb, var(--yellow) 40%, transparent); }

/* Tabs (mobile only) */
.tabs { display: none; }

/* Work split */
.work { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: .5rem; align-items: start; }
.panel { background: var(--prey-900); border-radius: 40px; padding: clamp(1.5rem, 3vw, 3rem); }
.panel h2 { font-size: var(--fs-h2); line-height: 1.2; }
.panel-intro { margin-top: .9rem; max-width: 60ch; }

.steps { list-style: none; margin: 2.5rem 0 0; padding: 0; counter-reset: s; }
.step { position: relative; padding: 0 0 2.25rem 3.5rem; }
.step::before { content: ""; position: absolute; left: 15px; top: 36px; bottom: 6px; width: 1px; background: var(--prey-700); }
.step:last-child { padding-bottom: 0; }
.step:last-child::before { display: none; }
.step-head { display: flex; align-items: center; gap: 1rem; margin-left: -3.5rem; min-height: 32px; }
.step-n { flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; background: var(--prey-750); border: 1px solid var(--prey-700); color: var(--prey-100); font-family: var(--font-display); font-weight: 700; font-size: .9375rem; }
.step-primary .step-n { background: var(--purple-500); border-color: var(--purple-500); color: #fff; }
.step h3 { font-size: var(--fs-h3); line-height: 1.3; }
.step h3 em { color: var(--purple-300); }
.step-body { margin-top: .75rem; display: grid; gap: .85rem; max-width: 62ch; }
.aside { font-size: .9375rem; color: var(--prey-400); }
.you-use[hidden] { display: none; }
.checks { margin: 0; padding: 0; list-style: none; display: grid; gap: .5rem; }
.checks li { position: relative; padding-left: 1.4rem; }
.checks li::before { content: ""; position: absolute; left: 0; top: .62em; width: 7px; height: 7px; border-radius: 2px; background: var(--purple-500); }

/* Link builder */
.builder { background: var(--black); border: 1px solid var(--prey-700); border-radius: 20px; padding: 1.25rem; display: grid; gap: .75rem; }
.builder-label { font-family: var(--font-display); font-size: var(--fs-sm); font-weight: 500; color: var(--prey-300); }
.builder input {
  width: 100%; font: 400 1.0625rem/1.4 var(--font-code); color: var(--white); background: var(--prey-900); border: 1px solid var(--prey-700);
  border-radius: 12px; padding: .8rem 1rem; transition: border-color .2s, background .2s;
}
.builder input::placeholder { color: var(--prey-400); }
.builder input:hover { border-color: var(--prey-600); }
.builder input:focus { outline: none; border-color: var(--purple-500); background: var(--prey-800); box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple-500) 25%, transparent); }
.link-chip { border-radius: 12px; background: var(--purple-500); padding: 4px; }
.link-chip code { display: block; background: var(--black); color: var(--prey-300); padding: .8rem 1rem; border-radius: 9px; font-size: .9375rem; line-height: 1.45; word-break: break-all; }
.lc-code { color: var(--purple-300); }
.lc-code.empty { color: var(--prey-600); }
.lc-code .ch { display: inline-block; animation: ch-in .45s var(--ease-out) both; }
@keyframes ch-in { from { opacity: 0; filter: blur(4px); transform: translateY(.35em); } }
.code-status { min-height: 1.3em; font-size: .875rem; color: var(--prey-400); }
.code-status.warn { color: var(--yellow); }
.code-status.ok { color: var(--green); }
.builder-actions { display: flex; flex-wrap: wrap; gap: .5rem; }

/* Fix panel */
.panel-fix { padding-top: 0; position: sticky; top: 5.25rem; max-height: calc(100vh - 5.75rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.fix-sticky { position: sticky; top: 0; z-index: 2; background: var(--prey-900); padding-top: clamp(1.5rem, 3vw, 3rem); padding-bottom: 1rem; }
.search { position: relative; margin-top: 1rem; }
.search svg { position: absolute; left: 1rem; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--prey-400); pointer-events: none; }
.search input {
  width: 100%; font: 400 1rem/1.4 var(--font-sans); color: var(--white); background: var(--black); border: 1px solid var(--prey-700);
  border-radius: 14px; padding: .85rem 1rem .85rem 2.75rem; transition: border-color .2s;
}
.search input::placeholder { color: var(--prey-400); }
.search input:focus { outline: none; border-color: var(--purple-500); box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple-500) 25%, transparent); }
.search input::-webkit-search-cancel-button { filter: invert(.6); }
.search-count { min-height: 1.2em; margin-top: .6rem; font-size: var(--fs-sm); color: var(--prey-400); font-family: var(--font-code); }

.fixes { border-top: 1px solid var(--prey-700); }
.fix { border-bottom: 1px solid var(--prey-700); scroll-margin-top: 13rem; }
@media (max-width: 900px) { .fix { scroll-margin-top: 5rem; } }
.fix[hidden] { display: none; }
.fix summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr 20px; grid-template-rows: auto auto; column-gap: 1rem; padding: 1.1rem .25rem; border-radius: 10px; }
.fix summary::-webkit-details-marker { display: none; }
.fix summary::after {
  content: ""; grid-column: 2; grid-row: 1 / span 2; align-self: center; width: 9px; height: 9px; justify-self: center;
  border-right: 1.6px solid var(--prey-400); border-bottom: 1.6px solid var(--prey-400); transform: translateY(-3px) rotate(45deg);
  transition: transform .3s var(--ease-out), border-color .2s;
}
.fix[open] summary::after { transform: translateY(2px) rotate(-135deg); border-color: var(--purple-300); }
.fix summary:hover .fix-sig { color: var(--purple-300); }
.fix-sig { color: var(--white); font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.02em; line-height: 1.3; transition: color .2s; }
.fix-what { color: var(--prey-400); font-size: .875rem; margin-top: .2rem; }
.fix-body { padding: 0 .25rem 1.4rem; display: grid; gap: .75rem; font-size: .9375rem; }
.fix-body ol { margin: 0; padding-left: 1.25rem; display: grid; gap: .45rem; }
.fix-body ol li::marker { color: var(--purple-400); font-family: var(--font-code); font-size: .85em; }
.fix:target, .fix.flash { animation: flash 1.6s var(--ease-out); }
@keyframes flash { from { background: color-mix(in srgb, var(--purple-500) 22%, transparent); } }
mark { background: color-mix(in srgb, var(--purple-500) 35%, transparent); color: var(--white); border-radius: 3px; padding: 0 .1em; }
.no-results { padding: 1.5rem .25rem; color: var(--prey-300); }

.support { margin-top: 2rem; padding: 1.5rem; border-radius: 24px; background: var(--prey-800); display: grid; gap: .9rem; font-size: .9375rem; }
.support h3 { font-size: 1.125rem; line-height: 1.3; }
.support-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.warn { display: flex; gap: .65rem; align-items: flex-start; color: var(--prey-100); padding: .85rem 1rem; border-radius: 12px; background: color-mix(in srgb, var(--yellow) 9%, var(--prey-900)); border: 1px solid color-mix(in srgb, var(--yellow) 35%, transparent); }
.warn svg { flex: none; width: 18px; height: 18px; margin-top: .15em; color: var(--yellow); }

/* Community and other credits */
.other { padding: clamp(4rem, 8vw, 7rem) 0 2rem; }
.other-list { margin: 0; display: grid; grid-template-columns: 2fr 1fr 1fr; border-top: 1px solid var(--prey-700); border-bottom: 1px solid var(--prey-700); }
.other-list > div { padding: 1.75rem 1.75rem 2rem; border-left: 1px solid var(--prey-700); }
.other-list > div:first-child { padding-left: 0; border-left: 0; }
.other-list dt { font-family: var(--font-display); font-weight: 700; font-size: 1.0625rem; letter-spacing: -0.02em; }
.other-list dt a { color: var(--white); text-decoration: none; }
.other-list dt a::after {
  content: ""; display: inline-block; width: .7em; height: .7em; margin-left: .4em; background: var(--prey-400); vertical-align: .05em;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M3 9 9 3M4.5 3H9v4.5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M3 9 9 3M4.5 3H9v4.5'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: background .2s;
}
.other-list dt a:hover::after { background: var(--purple-300); }
.other-list dt a:hover { color: var(--purple-300); }
.other-list dd { margin: .5rem 0 0; font-size: .9375rem; max-width: 46ch; }
.other-hero dt { color: var(--white); font-size: var(--fs-h2); line-height: 1.2; }
.other-hero dd { font-size: 1rem; max-width: 52ch; margin-top: .75rem; }
.other-list .other-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.1rem; }
.other-actions .btn-primary { padding: .7rem 1.1rem; font-size: .9375rem; border-radius: 12px; }

/* Footer */
.footer { max-width: 1480px; margin: 0 auto; padding: 3rem var(--gutter) 8rem; display: grid; gap: 1rem; font-size: var(--fs-sm); color: var(--prey-400); border-top: 1px solid var(--prey-800); }
.footer p { max-width: 90ch; }
.footer a { color: var(--prey-300); }
.footer a:hover { color: var(--purple-300); }

/* Responsive */
@media (max-width: 1080px) {
  .nav-links { display: none; }
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero h1 { max-width: 18ch; }
  .identity { max-width: 640px; }
}
@media (max-width: 900px) {
  .tabs {
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-bottom: .5rem;
    position: sticky; top: 4.25rem; z-index: 10; background: var(--prey-900); border: 1px solid var(--prey-700); border-radius: 16px;
  }
  .tabs button { font: 500 .9375rem/1 var(--font-display); color: var(--prey-300); background: transparent; border: 0; border-radius: 12px; padding: .8rem; cursor: pointer; transition: background .2s, color .2s; }
  .tabs button[aria-selected="true"] { background: var(--prey-700); color: var(--white); }
  .work { grid-template-columns: 1fr; }
  .panel { border-radius: 28px; }
  .panel[hidden] { display: none; }
  .other-list { grid-template-columns: 1fr 1fr; }
  .other-hero { grid-column: 1 / -1; border-bottom: 1px solid var(--prey-700); padding-right: 0 !important; }
  .other-list > div:nth-child(2) { padding-left: 0; border-left: 0; }
  .panel-fix { position: static; max-height: none; overflow: visible; }
  .fix-sticky { position: static; }
}
@media (max-width: 560px) {
  .nav { padding-left: .9rem; }
  .brand span { font-size: .875rem; }
  .identity-grid { gap: .4rem; }
  .id-tile { padding: .85rem; column-gap: .6rem; }
  .step { padding-left: 0; }
  .step::before { display: none; }
  .step-head { margin-left: 0; align-items: flex-start; }
  .other-list { grid-template-columns: 1fr; border-bottom: 0; }
  .other-list > div, .other-list > div:nth-child(2) { padding: 1.4rem 0 1.6rem; border-left: 0; border-bottom: 1px solid var(--prey-700); }
  .builder { padding: 1rem; }
  .builder-actions .btn { flex: 1 1 auto; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0s !important; }
}
