:root {
  --paper: #f1eee4;
  --panel: #fffdf7;
  --ink: #111916;
  --muted: #6c7771;
  --line: #cfd4cb;
  --soft-line: #e6e8e1;
  --green: #0ae448;
  --green-dark: #08772d;
  --green-soft: #daf7e1;
  --purple: #9d65ff;
  --purple-soft: #ece1ff;
  --coral: #ff6b54;
  --coral-soft: #ffe1d9;
  --blue: #4f78f4;
  --blue-soft: #e3eaff;
  --yellow: #ffd454;
  --yellow-soft: #fff2bd;
  --shadow: 0 24px 70px rgb(19 29 25 / 12%);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--paper); }
body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 3% 2%, rgb(10 228 72 / 12%), transparent 24%),
    radial-gradient(circle at 96% 4%, rgb(157 101 255 / 17%), transparent 25%),
    var(--paper);
  font-family: Inter, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}
button, a { color: inherit; font: inherit; }
button:focus-visible, a:focus-visible, [tabindex="0"]:focus-visible {
  outline: 4px solid rgb(157 101 255 / 28%);
  outline-offset: 3px;
}
button { cursor: pointer; }
code, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.page { width: min(1540px, calc(100% - 40px)); margin: 0 auto; padding: 30px 0 46px; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(410px, .55fr);
  align-items: end;
  gap: 28px;
  padding: 0 4px 25px;
}
.hero-copy { min-width: 0; }
.eyebrow { display: flex; align-items: center; gap: 10px; margin: 0 0 11px; color: var(--green-dark); font-size: 11px; font-weight: 900; letter-spacing: .14em; }
.eyebrow i { position: relative; width: 30px; height: 30px; border: 3px solid var(--ink); border-radius: 50%; }
.eyebrow i::before { position: absolute; inset: 5px -7px 5px 7px; background: var(--green); border: 2px solid var(--ink); border-radius: 50%; content: ""; }
h1 { margin: 0; font-family: "Arial Black", Inter, sans-serif; font-size: clamp(52px, 6.3vw, 95px); line-height: .94; letter-spacing: normal; }
h1 span { color: var(--purple); }
.lead { margin: 15px 0 0; color: var(--muted); font-size: clamp(16px, 1.45vw, 23px); font-weight: 800; line-height: 1.5; }
.lead strong { color: var(--ink); }
.hero-meta { display: grid; gap: 10px; }
.free-card { display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 4px 12px; min-height: 104px; padding: 17px 19px; color: #fff; background: var(--ink); border: 1px solid var(--ink); border-radius: 20px; box-shadow: var(--shadow); }
.free-card span { grid-column: 1 / -1; color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.free-card strong { font-size: clamp(17px, 1.7vw, 25px); }
.free-card b { color: var(--green); font-size: clamp(25px, 2.4vw, 40px); line-height: .9; }
.hero-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.docs-link, .utility-button { display: grid; min-height: 46px; place-items: center; padding: 0 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 13px; font-size: 10px; font-weight: 900; text-decoration: none; }
.utility-button { color: #fff; background: var(--purple); border-color: var(--purple); }

.gallery-shell, .detail-panel, .install-panel, .directory-shell { min-width: 0; overflow: hidden; background: var(--panel); border: 1px solid var(--line); border-radius: 26px; box-shadow: var(--shadow); }
.gallery-head, .directory-head { display: flex; min-height: 82px; align-items: center; justify-content: space-between; gap: 22px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.section-heading { display: flex; min-width: 0; align-items: center; gap: 12px; }
.section-heading > div { min-width: 0; }
.section-heading p, .detail-head p, .install-panel header > span { margin: 0 0 3px; color: var(--purple); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.section-heading h2, .detail-head h2, .install-panel h2 { margin: 0; font-size: clamp(18px, 1.5vw, 26px); line-height: 1.12; }
.section-mark { display: grid; flex: 0 0 48px; width: 48px; height: 48px; place-items: center; color: #fff; background: var(--purple); border-radius: 15px; font-size: 11px; font-weight: 900; }
.section-mark--green { color: var(--ink); background: var(--green); }
.section-mark--yellow { color: var(--ink); background: var(--yellow); }

.filters { position: relative; display: grid; grid-template-columns: repeat(6, auto); min-height: 44px; padding: 4px; background: #eff0eb; border: 1px solid var(--line); border-radius: 13px; }
.filters button { position: relative; z-index: 2; min-width: 58px; padding: 0 11px; background: transparent; border: 0; font-size: 10px; font-weight: 900; }
.filters i { position: absolute; z-index: 1; top: 4px; bottom: 4px; left: 4px; width: 58px; background: #fff; border-radius: 10px; box-shadow: 0 3px 8px rgb(17 25 22 / 10%); transition: left .32s var(--ease), width .32s var(--ease); }

.plugin-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; padding: 18px; background-image: linear-gradient(var(--soft-line) 1px, transparent 1px), linear-gradient(90deg, var(--soft-line) 1px, transparent 1px); background-size: 24px 24px; }
.plugin-card { position: relative; display: grid; min-width: 0; grid-template-rows: auto 168px auto; overflow: hidden; background: rgb(255 253 247 / 96%); border: 1px solid var(--line); border-radius: 18px; transition: border-color .25s, box-shadow .25s, opacity .25s, transform .25s; }
.plugin-card:hover, .plugin-card.is-selected { border-color: var(--purple); box-shadow: 0 12px 30px rgb(75 43 136 / 15%); transform: translateY(-2px); }
.plugin-card.is-hidden { display: none; }
.plugin-card > header { display: flex; min-height: 48px; align-items: center; gap: 8px; padding: 8px 10px 7px 13px; border-bottom: 1px solid var(--line); }
.plugin-card > header > span { padding: 5px 7px; color: var(--green-dark); background: var(--green-soft); border-radius: 999px; font-size: 10px; font-weight: 900; }
.plugin-card > header > b { min-width: 0; overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.plugin-card > header button { display: grid; flex: 0 0 31px; width: 31px; height: 31px; margin-left: auto; place-items: center; color: var(--muted); background: #f1f2ee; border: 1px solid var(--line); border-radius: 50%; font-size: 15px; font-weight: 900; }
.sample { position: relative; min-width: 0; overflow: hidden; background: #f4f4ef; }
.plugin-card > footer { display: grid; gap: 4px; min-height: 71px; align-content: center; padding: 11px 13px 13px; border-top: 1px solid var(--line); }
.plugin-card > footer strong { font-size: 11px; }
.plugin-card > footer small { color: var(--muted); font-size: 10px; font-weight: 700; }

.sample--flip { display: grid; place-items: center; background: var(--purple-soft); }
.flip-grid { display: grid; width: 160px; grid-template-columns: 1fr 1fr; gap: 8px; }
.flip-grid i { display: block; height: 52px; background: var(--purple); border: 3px solid var(--ink); border-radius: 13px; }
.flip-grid i:nth-child(2) { background: var(--green); }
.flip-grid i:nth-child(3) { background: var(--yellow); }
.flip-grid i:nth-child(4) { background: var(--coral); }
.flip-grid.is-switched i:first-child { order: 4; grid-column: span 2; }
.flip-grid.is-switched i:nth-child(2) { order: 2; }
.flip-grid.is-switched i:nth-child(3) { order: 1; }
.flip-grid.is-switched i:nth-child(4) { order: 3; }

.sample--drag { display: grid; place-items: center; padding: 20px; background: var(--green-soft); }
.drag-track { position: relative; width: 100%; height: 72px; background: rgb(255 255 255 / 70%); border: 2px dashed #8dcaa0; border-radius: 999px; }
.drag-puck { position: absolute; top: 9px; left: 9px; display: grid; width: 50px; height: 50px; place-items: center; color: #fff; background: var(--ink); border-radius: 50%; font-size: 10px; font-style: normal; font-weight: 900; touch-action: none; user-select: none; }

.sample--path, .sample--draw { display: grid; place-items: center; background: #eef2ff; }
.sample--path svg, .sample--draw svg { width: calc(100% - 24px); height: 130px; overflow: visible; }
.sample--path path { fill: none; stroke: #b5bfdc; stroke-dasharray: 5 5; stroke-width: 3; }
.path-dot { fill: var(--coral); stroke: var(--ink); stroke-width: 3; }
.sample--morph { display: grid; place-items: center; background: var(--coral-soft); }
.sample--morph svg { width: 145px; height: 140px; overflow: visible; }
.morph-shape { fill: var(--coral); stroke: var(--ink); stroke-width: 5px; }
.draw-line { fill: none; stroke: var(--purple); stroke-linecap: round; stroke-width: 9px; }
.sample--draw circle { fill: var(--green); stroke: var(--ink); stroke-width: 3px; }

.sample--split { display: grid; place-items: center; padding: 15px; background: var(--yellow-soft); }
.split-target { margin: 0; color: var(--ink); font-family: "Arial Black", Inter, sans-serif; font-size: clamp(23px, 2.4vw, 36px); line-height: .9; text-align: center; }
.sample--scramble { display: grid; place-items: center; background: var(--ink); }
.scramble-target { margin: 0; color: var(--green); font-family: ui-monospace, monospace; font-size: clamp(20px, 2vw, 31px); font-weight: 900; }
.sample--scramble i { position: absolute; right: 17px; bottom: 16px; width: 44px; height: 4px; background: var(--green); }

.sample--scroll { padding: 12px; background: #e7edff; }
.mini-scroll { position: relative; height: 144px; padding: 12px; overflow: auto; scroll-behavior: smooth; background: #fff; border: 2px solid var(--ink); border-radius: 12px; scrollbar-width: thin; }
.mini-scroll i { display: block; height: 54px; color: var(--blue); font-size: 10px; font-style: normal; font-weight: 900; }
.mini-scroll i:first-child { position: sticky; z-index: 1; top: 0; height: auto; padding: 5px 7px; background: rgb(255 255 255 / 90%); border-radius: 6px; }
.mini-scroll i:nth-of-type(2), .mini-scroll i:nth-of-type(3) { height: 65px; }
.mini-scroll b { display: grid; height: 70px; place-items: center; color: #fff; background: var(--blue); border-radius: 10px; font-size: 16px; opacity: .2; transform: translateY(20px) scale(.9); }
.mini-scroll b.is-visible { opacity: 1; transform: none; transition: opacity .45s, transform .45s var(--ease); }

.sample--bounce { background: #fff3c9; }
.sample--bounce b { position: absolute; right: 20px; bottom: 22px; left: 20px; height: 3px; background: var(--ink); }
.bounce-ball { position: absolute; z-index: 2; top: 20px; left: calc(50% - 24px); width: 48px; height: 48px; background: var(--yellow); border: 3px solid var(--ink); border-radius: 50%; transform-origin: center bottom; }
.sample--wiggle { display: grid; place-items: center; background: var(--coral-soft); }
.sample--wiggle > i { position: absolute; width: 105px; height: 105px; border: 2px dashed #df9f91; border-radius: 50%; }
.wiggle-card { position: relative; display: grid; width: 95px; height: 60px; place-items: center; color: #fff; background: var(--coral); border: 3px solid var(--ink); border-radius: 14px; font-size: 14px; }
.sample--physics { display: grid; place-items: center; background: #e5edff; }
.burst-source { position: relative; z-index: 2; display: grid; width: 69px; height: 69px; place-items: center; color: #fff; background: var(--blue); border: 3px solid var(--ink); border-radius: 50%; font-size: 10px; font-weight: 900; }
.particle { position: absolute; z-index: 1; top: calc(50% - 6px); left: calc(50% - 6px); width: 12px; height: 12px; background: var(--particle, var(--coral)); border: 2px solid var(--ink); border-radius: 50%; pointer-events: none; }
.sample--observer { display: grid; place-items: center; padding: 16px; background: #e2f7ef; }
.observer-pad { position: relative; display: grid; width: 100%; height: 112px; place-items: center; overflow: hidden; background: #fff; border: 2px solid var(--ink); border-radius: 14px; touch-action: none; }
.observer-pad > i { position: absolute; width: 58px; height: 58px; background: var(--green); border-radius: 50%; opacity: .2; }
.observer-pad > span { position: relative; margin-top: 42px; color: var(--green-dark); font-size: 10px; font-weight: 900; }
.observer-value { position: absolute; top: 10px; right: 12px; font-size: 19px; }

.detail-shell { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(330px, .6fr); gap: 18px; margin-top: 18px; }
.detail-panel { color: #fff; background: var(--ink); border-color: var(--ink); }
.detail-head { display: flex; min-height: 80px; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 18px; border-bottom: 1px solid #35403b; }
.section-heading--dark p { color: var(--green); }
.detail-head button { min-height: 42px; padding: 0 14px; color: var(--ink); background: var(--green); border: 0; border-radius: 12px; font-size: 10px; font-weight: 900; }
.detail-body { display: grid; grid-template-columns: minmax(260px, .7fr) minmax(380px, 1.3fr); gap: 18px; padding: 18px; }
.detail-copy { padding: 8px 4px; }
.detail-copy > span { color: var(--green); font-size: 10px; font-weight: 900; letter-spacing: .12em; }
.detail-copy h3 { margin: 13px 0 10px; font-size: clamp(21px, 2.2vw, 34px); line-height: 1.12; }
.detail-copy > p { margin: 0; color: #aeb8b3; font-size: 11px; font-weight: 700; line-height: 1.7; }
.detail-copy dl { display: grid; gap: 8px; margin: 19px 0 0; }
.detail-copy dl div { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding-top: 8px; border-top: 1px solid #34413b; }
.detail-copy dt { color: var(--green); font-size: 10px; font-weight: 900; }
.detail-copy dd { margin: 0; font-size: 10px; font-weight: 800; }
.code-card { min-width: 0; overflow: hidden; background: #070b09; border: 1px solid #37433e; border-radius: 16px; }
.code-card header { display: flex; min-height: 47px; align-items: center; justify-content: space-between; gap: 12px; padding: 0 13px; background: #19231f; border-bottom: 1px solid #37433e; }
.code-card header span { color: var(--green); font-size: 10px; font-weight: 900; }
.code-card header button { padding: 8px 10px; color: #fff; background: #2d3934; border: 0; border-radius: 9px; font-size: 10px; font-weight: 900; }
.code-card pre { max-height: 315px; margin: 0; padding: 17px; overflow: auto; color: #e8eee9; font-size: 11px; line-height: 1.7; white-space: pre-wrap; }

.install-panel { display: grid; align-content: start; padding: 19px; }
.install-panel header > span { color: var(--coral); }
.install-panel h2 { margin-bottom: 16px; }
.install-tabs { position: relative; display: grid; grid-template-columns: 1fr 1fr; min-height: 43px; padding: 4px; background: #eff0eb; border: 1px solid var(--line); border-radius: 12px; }
.install-tabs button { position: relative; z-index: 2; background: transparent; border: 0; font-size: 10px; font-weight: 900; }
.install-tabs i { position: absolute; z-index: 1; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); background: #fff; border-radius: 9px; box-shadow: 0 3px 8px rgb(17 25 22 / 10%); transition: left .3s var(--ease); }
.install-tabs:has(button:nth-child(2)[aria-selected="true"]) i { left: 50%; }
.install-panel pre { min-height: 76px; margin: 10px 0; padding: 15px; overflow: auto; color: var(--green); background: var(--ink); border-radius: 13px; font-size: 11px; line-height: 1.55; white-space: pre-wrap; }
.install-panel > p { margin: 2px 0 14px; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.55; }
.register-note { display: grid; grid-template-columns: 1fr auto; gap: 5px; padding: 13px; background: var(--green-soft); border: 1px solid #a7d8b4; border-radius: 13px; }
.register-note span { color: var(--green-dark); font-size: 10px; font-weight: 900; }
.register-note code { grid-column: 1 / -1; font-size: 10px; font-weight: 800; }
.register-note b { grid-column: 2; grid-row: 1; font-size: 10px; }

.directory-shell { margin-top: 18px; }
.directory-head > p { max-width: 420px; margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; line-height: 1.55; text-align: right; }
.directory-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 18px; background: #f7f5ee; }
.directory-grid article { min-height: 98px; padding: 14px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.directory-grid span { color: var(--purple); font-size: 10px; font-weight: 900; }
.directory-grid h3 { margin: 8px 0 5px; font-size: 15px; }
.directory-grid p { margin: 0; color: var(--muted); font-size: 10px; font-weight: 700; }
.directory-shell > footer { display: flex; justify-content: space-between; gap: 20px; padding: 13px 18px; color: var(--muted); border-top: 1px solid var(--line); }
.directory-shell > footer span, .directory-shell > footer p { margin: 0; font-size: 10px; font-weight: 700; }

.toast { position: fixed; z-index: 20; right: 20px; bottom: 20px; padding: 12px 16px; color: #fff; background: var(--ink); border-radius: 12px; box-shadow: var(--shadow); font-size: 11px; font-weight: 900; opacity: 0; translate: 0 12px; pointer-events: none; transition: opacity .25s, translate .35s var(--ease); }
.toast.is-visible { opacity: 1; translate: 0 0; }

@media (max-width: 1180px) {
  .hero { grid-template-columns: 1fr; }
  .hero-meta { grid-template-columns: 1fr 1fr; }
  .free-card { min-height: 86px; }
  .hero-actions { align-content: end; }
  .plugin-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-shell { grid-template-columns: 1fr; }
  .install-panel { grid-template-columns: 1fr 1fr; gap: 12px 18px; }
  .install-panel header { grid-column: 1 / -1; }
  .install-panel .register-note { align-self: start; }
}

@media (max-width: 860px) {
  .page { width: min(100% - 24px, 700px); padding-top: 18px; }
  .hero-meta { grid-template-columns: 1fr; }
  .gallery-head, .directory-head { align-items: flex-start; flex-direction: column; }
  .filters { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .filters button { min-width: 0; min-height: 36px; }
  .filters i { display: none; }
  .filters button[aria-pressed="true"] { color: #fff; background: var(--purple); border-radius: 9px; }
  .plugin-grid { grid-template-columns: repeat(2, 1fr); }
  .detail-body { grid-template-columns: 1fr; }
  .directory-grid { grid-template-columns: repeat(2, 1fr); }
  .directory-head > p { text-align: left; }
}

@media (max-width: 560px) {
  .page { width: calc(100% - 16px); }
  h1 { font-size: clamp(42px, 13vw, 65px); }
  .hero { padding-inline: 2px; }
  .hero-actions { grid-template-columns: 1fr; }
  .gallery-head, .directory-head { padding: 14px; }
  .section-mark { flex-basis: 42px; width: 42px; height: 42px; }
  .plugin-grid { grid-template-columns: 1fr; padding: 10px; }
  .plugin-card { grid-template-rows: auto 185px auto; }
  .detail-head { align-items: flex-start; flex-direction: column; }
  .detail-head button { width: 100%; }
  .detail-body { padding: 13px; }
  .install-panel { display: block; padding: 15px; }
  .install-tabs { margin-top: 14px; }
  .directory-grid { grid-template-columns: 1fr; padding: 10px; }
  .directory-shell > footer { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
